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

store original proj4 representation of a CRS in the QgsCoordinateReferenceSystem class #1130

Closed
wants to merge 1 commit into from

Conversation

leyan
Copy link
Contributor

@leyan leyan commented Jan 30, 2014

Currently, when creating a custom CRS, the string entered by the user is not saved but only used to create a CRS by calling the function OSRImportFromProj4 from OGR. The proj4 shown when listing the custom CRS is the proj4 generated by a call to OSRExportToProj4.

This behavior means the string is modified without informing the user, changing the order of the arguments, adding or removing defaut values, etc. This is confusing and IMHO a behavior that should be avoided. Additionally, the two strings (input and OGR export) are supposed to be equivalent, but this is not always the case. The CRS replacement can be involved in issues such as http://hub.qgis.org/issues/9414.

This pull request adds a field mProj4 to the QgsCoordinateReferenceSystem, in order to be able to save the preferred proj4 representation and use it if possible. If no field has been defined, the OSRExportToProj4 is used. I have more ambitious changes I would like to make later, but this seems to solve bug #9414, so I would like to include this small modification for 2.2.

@mhugent mhugent self-assigned this Feb 4, 2014
@mhugent
Copy link
Contributor

mhugent commented Feb 4, 2014

assigned to @mhugent

@mhugent
Copy link
Contributor

mhugent commented Feb 10, 2014

Pull request applied, thank you Leyan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants