0

When working in a projected map (project properties have a projection chosen), QGIS calculates longitude ($x) and latitude ($y) values for each point (or polygon centroid) as decimal degrees. (This is when using the field calculator to obtain lat/long). What geodetic reference system is QGIS using to provide lat/long values when using the field calculator?

I have made a few trials with a shapefile in WGS 84 and NAD 83 and the decimal.degrees values are the same in both shapefiles. However, they shouldn't be have the same values past the 5th or 6th decimal (based on using an online conversion tool from WSG 84 to NAD 83: https://tagis.dep.wv.gov/convert/)

EDIT: clarify the steps I made to test decimal.degrees values in a project using a projected CRS (NAD 83 MTM8)

  1. Create new point shapefile
  2. Create random cluster of points
  3. Save point shapefile with WGS 84 as CRS (points_WGS84.shp)
  4. Save point shapefile with NAD 83 as CRS (points_NAD83.shp)
  5. Load points_WGS84.shp in QGIS
  6. Open attribute table, open field calculator, create new field (long) with 8 decimal points, enter $x in the calculator box [points_WGS84.shp file]
  7. Open attribute table, open field calculator, create new field (lat) with 8 decimal points, enter $y in the calculator box [points_WGS84.shp file]
  8. Load points_NAD83.shp in QGIS
  9. Open attribute table, open field calculator, create new field (long) with 8 decimal points, enter $x in the calculator box [points_NAD83.shp file]
  10. Open attribute table, open field calculator, create new field (lat) with 8 decimal points, enter $y in the calculator box [points_NAD83.shp file]
  11. Open attribute tables for points_WGS84.shp and for points_NAD83.shp
  12. Compare values between both tables --> conclusion: they are identical to the last decimal
  • If you use the field calculator to populate a field with lat/long values, that field will not automatically update when the lat/long changes. Use a Virtual Field if you want an auto-updating field. – csk Jul 24 '18 at 18:16
  • I am not interested in automatically updating the lat/long values. I want to know what geodetic reference system QGIS is using initially. – user3386170 Jul 24 '18 at 20:07
  • My point was just that you need to manually re-calculate the lat/long value when you change the CRS. If you did that already, then it's not relevant. If you didn't, your underlying assumption (that QGIS gives the same decimal degree value in WGS84 and NAD83) might be incorrect. – csk Jul 24 '18 at 20:23
  • I created one file with the projection WGS84 and one file in NAD83. THEN I used field calculator to obtain lat and long, which were in decimal.degrees. – user3386170 Jul 24 '18 at 20:25
  • The NAD83 definition in QGIS probably doesn't have a +TOWGS84 parameter in its definition, so no conversion has been / will be done. – mkennedy Jul 24 '18 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.