Hi devs,

What is the correct way to extract the EPSG code from an OGRSpatialReferenceH ?

Currently I'm finding that the following works only for SRS of some images and 
not others:

        const char *charAuthType = OSRGetAttrValue(gdal.srcSRS, "AUTHORITY", 0);
        const char *charSrsCode = OSRGetAttrValue(gdal.srcSRS, "AUTHORITY", 1);

However, there is no "AUTHORITY" node in some SRSs so it doesn't work for those 
images.  To cater for this, I'm trying to explicitly set the authority node 
using:

        OSRAutoIdentifyEPSG(gdal.srcSRS);

But this fails with OGRERR_UNSUPPORTED_SRS (even when it is an SRS that GDAL 
recognises and uses well).

So I'm stumped... how do I reliably determine the EPSG for an 
OGRSpatialReferenceH?

Cheers,
Nik.

_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to