Switching CRS On The Fly messes up area calculations #17307
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Projections/Transformations
Related to coordinate reference systems or coordinate transformation
Author Name: Charles Rethman (Charles Rethman)
Original Redmine Issue: 8558
Affected QGIS version: master
Redmine category:projection_support
My data covers whole Southern Africa region -- South Africa up to DRC-- therefore it is stored in Long-Lat WGS84. However, I need to do many calculations with the data such as area, distances etc. and therefore I project to Albers EAC or Lamberts CC (I use UTM for Malawi, Swaziland and Lesotho). I have defined a set of "national" Albers EA CRSs and saved them as user-defined or custom CRSs in QGIS 1.9. The bug happens as follows: I load a set of data that are in Long-Lat and then enable Set CRS On The Fly and change project CRS to my user-defined (custom) one. All the layers are reprojected. If I now load a layer that is in the custom CRS, and then use the Field Calculator to add a column and calculate something on the geometry (such as $Area), I get nonsense numbers in the new calculated field. To get a sensible result, I must first close the file with the long-lat dat in it, and then open the file with the only the custom projection data. I can then do the calculations I require.
In short, it appears QGIS does not like layers with different CRSs, even if they are reprojected On The Fly to whichever one is working in . It works reliably when all the layers have the same CRS.
My Albers EA proj4 definition is +proj=aea +lat_1=-19.3 +lat_2=-25.38 +lat_0=0 +lon_0=24.69 +x_0=500000 +y_0=3000000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs.
Example data for Botswana also supplied.
The text was updated successfully, but these errors were encountered: