Bug report #10821
area calculation error after CRS changes
|Affected QGIS version:||2.4.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||19197|
Submitted on behalf of Therese Forsyth
Testing QGIS 2.4 with area calculations. File used attached.
I had a veg map with correct areas calculated using ArcView/ArcGIS (Xarea, Xhectares).
Just opened QGIS 2.4, loaded the projected veg shapefile and calculated the areas (Auto_ha) CORRECT
Went to “Settings | Options”, ticked on “enable on-the-fly….” and then again calculated the areas (otf_tm_ha) CORRECT
Then I went to “Project properties | CRS”, ticked on “projection-on-the-fly”, selected TM and calculated areas (otfr_tm) ERROR
Then back at “Project properties | CRS”, changed projection to UTM and calculated areas (otfr_utm) ERROR
Then I closed QGIS and reopen it. When I opened it from scratch, I checked the settings and the system kept the settings as it were when I closed the software. Under “Settings | Options” the “Enable on-the-fly…” was selected, and under “Project properties | CRS” the “projection-on-the-fly” box was ticked on. I ran a calculation without making any changes (area) CORRECT
Then I went to “Project properties | CRS”, changed the projection to UTM and apply, but then immediately changed it rather to TM and apply. I then again ran the calculation of the areas (area1) ERROR
I am not sure what to think of this and how to fix this. I am not even to sure how to pinpoint where the problem comes in. It just seems that the minute you make changes (does not matter what) under “Project properties | CRS”, your area calculations go absolutely haywire.
I can confirm the same error in 2.5 Master. The layer's geometry is in "South African CRS : HBK_NO_27" CRS. I know that Therese is mistaken in some of her experiments thinking that projecting on the fly might affect area calculations since the calculations occur on the native geometry, not in the projected space (right?). Which means that the area calculation should be the same no matter what project CRS is set and also should be correct every time, which is not the case.
#1 Updated by Giovanni Manghi over 7 years ago
- Status changed from Open to Feedback
Which means that the area calculation should be the same no matter what project CRS is set and also should be correct every time, which is not the case.
well... no. QGIS by design works in a different way: when OTFR is ON the values are computed in project CTS units and using the ellipsoid defined in
project properties -> general -> measure tools -> ellipsoid
you can also choose to manually set it to "none/planar" to have always your measures done on a plane.