Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1146 closed bug (fixed)

Custom Projection Definition

Reported by: alf Owned by: nobody
Priority: major: does not work as expected Milestone:
Component: Projection Support Version: 0.10.0
Keywords: Projection, Custom, ellps, proj4, ellipsoid Cc: afrigeri@…, thare@…
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

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

Change History (4)

comment:1 by timlinux, 16 years ago

Milestone: Version 0.11.0

comment:2 by timlinux, 16 years ago

Resolution: fixed
Status: newclosed

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.

/ I am commenting this check out for now because of ticket #1146

  • 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 */

Many thanks

Regards

Tim

comment:3 by timlinux, 16 years ago

Fix was applied as r8748.

comment:4 by (none), 15 years ago

Milestone: Version 0.11.0

Milestone Version 0.11.0 deleted

Note: See TracTickets for help on using tickets.