4

I'm working on a set of points for which I need coordinates, in QGIS. I'm not an expert in GIS, so I already know I'm wrong with something that should not be so complicated.

I don't understand why all the fields that I prepared two years ago with coordinates (calculated of field calculator) are now empty, except for one point. So I was trying to calculate the coordinates again, but I'm facing some issues.

I'm working in EPSG:32633 (just because a government office gave me lots of shapefiles in this CRS) and so both the project and the point shapefile are in this CRS. The coordinates for that only point are right and if you take them and search on Google Earth they point exactly on the building the point represent.

When I do again the updating of all fields with field calculator, also the right coordinates of that point change enormously (e.g. from 41,38842, the exact one, to 4575122,019169531). Maybe I need to do some conversion for showing up the same coordinates that Google Earth use, I don't know (I didn't transformations before, they were simply calculated with $x and $y variables that today are deprecated).

They should be workable for GE, just because I need to attach these coordinates to some printed record cards and usually people use Maps or Google Earth to find places.

1
  • The standard distance unit for EPSG:32633 is meter, you are looking for the longitude and latitude in degrees. Commented Jul 3 at 12:36

1 Answer 1

9

$x and $y calculate the coordinates using the CRS of the layer. If you need the coordinates in a different CRS, e.g. WGS 84 in decimal degrees, you need to use the transform() expression.

In your case the full expression for returning the x-coordinate in decimal degrees would be x(transform($geometry,'EPSG:32633','EPSG:4326')).

1
  • Thank you, it works! I used $x and $y at least two years ago, but now is deprecated and in the field calculator they give me only errors. About transformation, I tried but I was using the function in a wrong way (the two CRS were inverted...). In this way, it works. Thank you again! Commented Jul 6 at 6:52

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.