[gdal-dev] orginfo and prj files

Frank Warmerdam warmerdam at pobox.com
Thu Aug 14 18:25:33 EDT 2008


On Thu, Aug 14, 2008 at 5:14 PM, Lucena, Ivan <ivan.lucena at pmldnet.com> wrote:
>>  Your earlier question related to whether it was possible to establish
>>  what EPSG coordinate system an ESRI .prj file is.  There is no practical
>>  way to do this with OGRSpatialReference.
>
> So, one would need to write a C/C++ code to go through the csv tables (using the CPL_CSV.h type and functions) trying to match the names/values in order to recover the codes, keeping track of the relationships between Datum, Reference system and Projection system. Not a easy task and also process time consuming, I believe.

Ivan,

This approach can work to some degree, but it is not clear that the
names for datums from an ESRI WKT will match the name we fetch
from the EPSG tables (for instance).

> But one end-user practical solution would be to use org2org to export to another format which the driver does explicitly shows the EPSG code. Would that be possible? Does other OGR driver shows authority code?

Generally this won't work well because GDAL/OGR can't easily figure out the
EPSG codes to write to formats like GeoTIFF that would normally include
the EPSG codes.

I will note there is an AutoIdentifyEPSG() method on the OGRSpatialReference
which makes a preliminary effort to add EPSG authority codes to definitions.  I
believe now it just recognises a few well known coordinate systems like NAD27,
WGS84, etc.  So not very useful.

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