[Gdal-dev] Projection Parameters

Frank Warmerdam warmerdam at pobox.com
Thu Jan 8 13:26:56 EST 2004


Grabowski, Hank wrote:
> Hello again,
>  
> We are continuing to use, quite successfully, the OGR library for doing 
> automatic reprojections of data for our application.  However in 
> internal testing I found a weird issue with some of the Parameter 
> variables.  I noticed that there are certain keywords, like 
> Central_Meridian and Latitude_Of_Origin that vary between ESRI code and 
> the OGR code.  Looking at it in debug mode I discover that the 
> ValidateProjection method is aware of the discrepancy and is able to map 
> between the OGR values, Longitude_of_Center and Latitude_Of_Center in 
> this case, but instead throws an error and aborts the loading process.  
> Should the true behavior be for the code to remap the names to their 
> respective OGR values?  If the internal code is capable of parsing it, 
> thus removing the need for actually changing the label, shouldn't the 
> loop continue on and allow future variables to be read anyway? 

Hank,

The Validate() method is (in theory) intended to verify that a given
OGRSpatialReference is fully legitimate according to OGC WKT specs.
It doesn't really do that all that well, but it tries.  So it values to
validate aliases because they aren't the "legal" values.

I presume what you really want is a Validate() method that verifies that
an OGRSpatialReference is usable form, as opposed to being "standards
compliant".  Is that right?  Unfortuatenly, that currently doesn't exist.
I would suggest just trying to use the coordinate systems, and see if they
fail.

I would also note that when loading ESRI WKT projections, you should consider
using the morphFromESRI() method to convert ESRI names to more normal OGR names.
The Fixup() method is also useful in filling in defaults and fixing some things
that can be technically wrong when pulled in from various WKT sources.

I hope this helps.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list