qgis/Quantum-GIS — pull request #315 by leyan (2012-11-04 10:47:46+00:00)
Title: Update to custom CRS management

Hello developers,

I work a lot with custom CRS (not by choice !), and the current interface is quite cumbersome to use: the CRS can only be seen one by one, the saving behavior is quite unintuitive, parameters from an existing CRS cannot be seen easily, etc.

I tried to improve the UI and to update the code to use the QgsCoordinateReferenceSystem class. This reduces the code size and duplication, should improve the CRS validity check and later easily allow inputs other than proj4.

One issueI ran into is that QgsCoordinateReferenceSystem is not very fit to work with CRS not yet saved. The createFromProj4() function will automatically save a CRS if it is not found in the database, behavior that I had to slightly change by adding an optional argument to the function.

Currently, I minimized the changes to QgsCoordinateReferenceSystem. If more changes are allowed, I think it would be cleaner to separate the creation and saving to database: essentially make a function saveAsUserCRS(QString name) publicly available. The name could be used to convey more information than the current "Generated ..." default message.

Any comment ? Criticism ? On the code, the UI, the coding style, the pull request process ?