Bug report #1146

Custom Projection Definition

Added by Alessandro Frigeri about 12 years ago. Updated about 11 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Projection Support
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

Description

Hello,

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).

Best regards,

Alessandro Frigeri

History

#1 Updated by Tim Sutton about 12 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Hi

Ok 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

Many thanks

Regards

Tim

#2 Updated by Tim Sutton about 12 years ago

Fix was applied as ee275abf (SVN r8749).

#3 Updated by Anonymous about 11 years ago

Milestone Version 0.11.0 deleted

Also available in: Atom PDF