qgis/QGIS — pull request #1130 by leyan (2014-01-30 16:11:15+00:00)
Title: store original proj4 representation of a CRS in the QgsCoordinateReferenceSystem class

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 or http://hub.qgis.org/issues/8487.

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.