[gdal-dev] Get EPSG code from WKT

Robert Coup robert.coup at koordinates.com
Fri Feb 19 03:07:11 PST 2016


Hi Gane,

On 19 February 2016 at 10:50, Gane R <gane.prog at gmail.com> wrote:

>
> but when -s_srs EPSG:26945 is part of the command line it works fine, how
> do I know the the correct EPSG code from the WKT as there are more than one
> AUTHORITY code with EPSG value ?
>

There's (potentially) an Authority code for each *section* in the WKT. You
want the code for the *outermost* (in this case PROJCS, but will be GEOGCS
if it's a geographic coordinate system).

Different coordinate systems may have additional (or missing) Authority
codes -- eg. Shapefile PRJs from ArcGIS didn't include Authority codes for
a long time.


> PROJCS["NAD83 / California zone 5",   <= the projected coordinate system
>     GEOGCS["NAD83",   <= the geographic coordinate system the projection
> is based on
>         DATUM["North_American_Datum_1983",   <= the datum the geographic
> CS is based on
>             SPHEROID["GRS 1980",6378137,298.257222101,  <= the spheroid
> the datum is based on
>                 AUTHORITY["EPSG","7019"]],   <= code for the GRS1980
> spheroid
>             TOWGS84[0,0,0,0,0,0,0],
>             AUTHORITY["EPSG","6269"]],  <= code for the NAD83 datum
>         PRIMEM["Greenwich",0,   <= prime meridian
>             AUTHORITY["EPSG","8901"]],  <= code for the Greenwich meridian
>         UNIT["degree",0.0174532925199433,  <= units for the NAD83
> geographic CS
>             AUTHORITY["EPSG","9122"]],  <= code for Degree units
>         AUTHORITY["EPSG","4269"]],  <= code for the NAD83 geographic CS
>     PROJECTION["Lambert_Conformal_Conic_2SP"],
>     PARAMETER["standard_parallel_1",35.46666666666667],
>     PARAMETER["standard_parallel_2",34.03333333333333],
>     PARAMETER["latitude_of_origin",33.5],
>     PARAMETER["central_meridian",-118],
>     PARAMETER["false_easting",609601.2192024384],
>     PARAMETER["false_northing",152400.3048006096],
>     UNIT["Meter",1],
>     AXIS["X",EAST],
>     AXIS["Y",NORTH],
>     AUTHORITY["EPSG","26945"]] <= code for the NAD83/California Zone 5
> projected CS
>

HTH,

Rob :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160219/30fdae91/attachment-0001.html>


More information about the gdal-dev mailing list