[GRASS-dev] Improved ellipsoid name support
Paul Kelly
paul-grass at stjohnspoint.co.uk
Mon Nov 6 16:12:36 EST 2006
Yesterday I committed to CVS some updates to the gproj library that I'd
had sitting around for ages. They do the following things:
1. When generating a WKT projection description, put the full ellipsoid
name from ellipse.table in the "SPHEROID" section. The short name stil
goes in the "GEOGCS" section.
2. When generating a GRASS PROJ_INFO file from an input projection
description, try to put the ellipsoid name into the PROJ_INFO where
possible, instead of just a and es parameters. People had complained about
this before. The new functionality works as follows:
a) If a datum name is specified, use the ellipsoid associated with that
datum (i.e. ignore the ellipsoid parameters)
b) If there is no datum specified, try and match the ellipsoid parameters
against the known ellipsoids in ellipse.table (within a specified
tolerance - see the code in lib/proj/convert.c around line 521; comments
welcome) and use the first one that matches
c) Only if a) and b) both fail, put the a and es parameters into
PROJ_INFO directly as present
These changes should make the PROJ_INFO files generated by g.proj (and
r.in.gdal, v.in.ogr) more like those generated by g.setproj and should
hopefully make it more viable to use these functions as some kind of total
replacement for g.setproj in the future (at present I'm not sure how!).
Paul
More information about the grass-dev
mailing list