Feature request #4078

Enable CRS conversion in field calculator

Added by Alister Hood over 5 years ago. Updated over 1 year ago.

Status:Closed Start Date:07/14/2011
Priority:Low Due date:
Assigned to:- % Done:

0%

Category:Vectors
Target version:Future Release - Nice to have
Platform: Resolution:fixed/implemented
Platform version: Pull Request or Patch supplied:No
Status info: Tag:

Description

When using functions like $x, $y, xat(n) and yat(n) the coordinate is returned in the layer CRS.
It would be useful to also be able to get these in the Project CRS or another specified CRS. I understand this is a very popular ability in Mapinfo ;)

I'm assigning low priority because I think it is currently possible to workaround it by making a copy of the file in the other CRS.

History

Updated by Alister Hood over 5 years ago

  • Pull Request or Patch supplied set to No

this would also apply to the area and length functions

Updated by Giovanni Manghi over 5 years ago

  • Target version set to Version 1.7.4

Updated by Alister Hood about 5 years ago

Also see #4857: Add unit type to $area calculation

Updated by Giovanni Manghi almost 5 years ago

  • Target version changed from Version 1.7.4 to Version 2.0.0

Updated by Pirmin Kalberer over 4 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

Updated by Médéric RIBREUX over 1 year ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

Hello, bug triage...

there is now a transform function in QGIS expressions that make the CRS conversion. You can use it like this to get the x coordinate of a point converted from EPSG:4326 to EPSG:2154:

x(transform($geometry, 'EPSG:4326', 'EPSG:2154'))

For xat (which is replaced with point_n):

x(transform(point_n($geometry, 3), 'EPSG:4326', 'EPSG:2154'))

I am now closing this feature request as there is a way to make the CRS conversion directly from the expression dialog.

Also available in: Atom