[gdal-dev] Unable to obtain EPSG from OGRSpatialReference

Ian Lilly ianjlilly at gmail.com
Wed Jun 7 00:32:51 PDT 2017


Andre,
My reading of his description is that he's using projected coords (i.e.
metres) so for UTM 17N isn't that this - https://epsg.io/32617?
EPSG4326 is WGS84, geographic (lat/lon) which defines the spheroid used in
UTM.

I'm not a C++ programmer nor have I read the docs for the GDAL API -
perhaps it's not the correct function?

Ian Lilly
+60 1 7608 5310


On 7 Jun 2017 13:46, "Andre Joost" <andre+joost at nurfuerspam.de> wrote:

Am 07.06.2017 um 02:35 schrieb Mike K:

> Hello,
>
> I have a situation in which I would like to load up a set of polygons, and
> determine what EPSG code they are using.  I am testing with a simple square
> polygon in upstate New York using the UTM projection, saved into a
> Shapefile
> .
>
> I am able to create my dataset, layer, and read the geometry just fine.  I
> can get access to the spatial reference, but if I call the
> OGRSpatialReference::GetEPSGGeogCS() function, it always returns code
> 4326 (
> which is lat/lon ).  This is not correct, but if I query other values, they
> seem to be valid.  For instance, OGRSpatialReference::GetUTMZone() will
> return 17 N, which is correct.
>
> Does anybody know why I might be getting the wrong EPSG code?  I had
> thought
> I might just have bad data, but the fact that I can get the values
> individually makes me think it is something about how I am using the
> functions.  Thank you for any advice.
>
>
What EPSG code do you think is "right" ?

Many projected coordinate systems are based on a geographical coordinate
system more or less identical to WGS84 (EPSG:4326).

HTH,
André Joost



_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170607/304058e7/attachment.html>


More information about the gdal-dev mailing list