[gdal-dev] Easy way to tell if my image is EPSG 4326

Billy Newman newmanw10 at gmail.com
Thu Jul 12 14:27:42 PDT 2012

I am using java bindings to read in some metadata from image files.  I have
a check for images that are in EPSG:4326 (if not I warp them).  However I
have an image which I know is EPSG:4326 that has the following:

This is the constant from gdal I am using to compare:
org.gdal.osr.osrConstants.SRS_WKT_WGS84 =

So obviously when I do a string  comparison the two strings do not match.

1. my file is marked wrong and I am hosed.  This is tough cause I have
thousands of these files.
2. There is a much better way to look at the images projection string to
determine that it is EPSG:4326 and not some other projection.  I also have
file that are in a Transverse Mercator projection and its projection string
contains "EPSG 4326", so I know that I cannot just check for that in the
projection string.

So in the end my question is this: how can I tell from the projection
string metadata that I get from a GDAL Dataset object (Java) if it is

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120712/7d8ef5c3/attachment.html>

More information about the gdal-dev mailing list