Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching CRS On The Fly messes up area calculations #17307

Closed
qgib opened this issue Sep 2, 2013 · 4 comments
Closed

Switching CRS On The Fly messes up area calculations #17307

qgib opened this issue Sep 2, 2013 · 4 comments
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

Comments

@qgib
Copy link
Contributor

qgib commented Sep 2, 2013

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.


@qgib
Copy link
Contributor Author

qgib commented Sep 3, 2013

Author Name: Giovanni Manghi (@gioman)


it seems duplicate of #14476 - please leave feedback.


  • status_id was changed from Open to Feedback
  • os_version was changed from 10.8 to
  • operating_system was changed from Mac OS X Mountain Lion to
  • priority_id was changed from High to Normal

@qgib
Copy link
Contributor Author

qgib commented Sep 3, 2013

Author Name: Charles Rethman (Charles Rethman)


Looking at #14476, my issue is similar, although more specific to 1.9 (2.0 alpha) because the Field Calculator is now a part of the core app functionality. It would make sense to merge the two issues if you like but I think it's important to this release. Also, my feature request #17308--Field Calculations on geometry (such as $Area) should take place in the Project CRS (even that has been re-projected "on the fly") and not in the CRS of the original file--is related to this bug.


  • assigned_to_id was configured as Giovanni Manghi

@qgib
Copy link
Contributor Author

qgib commented Oct 11, 2014

Author Name: Giovanni Manghi (@gioman)


  • assigned_to_id removed Giovanni Manghi

@qgib
Copy link
Contributor Author

qgib commented May 10, 2015

Author Name: Giovanni Manghi (@gioman)


see #20259


  • resolution was changed from to duplicate
  • status_id was changed from Feedback to Closed

@qgib qgib added 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 labels May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant