Bug report #1146
Custom Projection Definition
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||11206|
while adding a projection definition in the Custom Projection Definition dialog, if I pass 'a' and 'b' parameters instead the 'ellps' I got the error message: "This proj4 ellps definition is not valid. Please add a valid ellps clause before pressing save".
Even adding the ellipsoid name (e.g. foo) and relative parameters to qgis.db and passing +ellps=foo does not work, as qgis rises up: "This proj4 definition is not valid. Please correct before saving".
To fix this beaviour temporarily I commented out lines 775-780 of src/app/qgscustomprojectiondialog.cpp ( conditional statement on myEllipsoidAcronym.isNull() ); in this way, the projection definition is accepted also with 'a' and 'b' parameters and the reprojection on the fly works as expected (I've checked coordinates with proj using the same proj4 definition on the command line).
#1 Updated by Tim Sutton about 13 years ago
- Resolution set to fixed
- Status changed from Open to Closed
HiOk so I agree its probably best to comment out the check for now since there are a number of non ellps+ ways to specify the ellipsoid. In the future we could implement more sophisticated checks to try to validate the various permutations, but for now the fact that the proj string in its entirety is checked in the code that follows this block should be sufficient. Here is the comment I placed in the code.
- In 1.0.0 we should consider doing more sophisticated checks or just
- removing this commented block entirely. It is possible to set the
- parameters for the earths figure in ways other than using ellps (which
- is a convenience function in proj). For example the radius and flattenning
- can be specified and various other parameter permutations. See the proj
- manual section entitled 'Specifying the Earths Figure' for more details.
- Tim Sutton */
/** I am commenting this check out for now because of ticket #1146