[gdal-dev] Importing ESRI (EPSG?) 102008 in GDAL 3.x/PROJ 6

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Importing ESRI (EPSG?) 102008 in GDAL 3.x/PROJ 6

Daniel Evans-2

Hi all,

 

While upgrading some Python software from using GDAL 2.3 to GDAL 3, I’ve come across this snippet of code:

 

srs = osr.SpatialReference()

srs.ImportFromEPSG(102008)

 

This used to work, but now fails with GDAL 3 / Proj 6 with “crs not found”.

 

Projection code 102008 corresponds to “ESRI:102008” described here, which the WKT output describes as “EPSG 102008”: https://epsg.io/102008

 

Is there an easy way to create an SRS from the code 102008 (perhaps with some prefix/suffix) in GDAL 3 / PROJ 6? The projection and its code are included in the PROJ source data (https://github.com/OSGeo/PROJ/blob/master/data/sql/esri.sql), but I can’t figure out what combination of “ImportFrom…” function and projection code format to use.

 

 

(There is a possibility that the GDAL 2.3 build we have has 102008 added into the data files – the history of the custom fork of GDAL we’re moving away from isn’t well documented)

 

Dr. Daniel Evans

Software Developer

 

<a href="sip:daniel.evans@jbarisk.com">Skype

 

T +44 (0) 1756 799919
www.jbarisk.com

Visit our website  Follow us on Twitter

Our postal address and registered office is JBA Risk Management Limited, 1 Broughton Park, Old Lane North, Broughton, Skipton, North Yorkshire BD23 3FD.

Find out more about us here: www.jbarisk.com and follow us on Twitter @JBARisk and LinkedIn

The JBA Group supports the JBA Trust.

All JBA Risk Management's email messages contain confidential information and are intended only for the individual(s) named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system.
 

JBA Risk Management Limited is registered in England, company number 07732946, 1 Broughton Park, Old Lane North, Broughton, Skipton, North Yorkshire, BD23 3FD, Telephone: +441756799919

 


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Importing ESRI (EPSG?) 102008 in GDAL 3.x/PROJ 6

Even Rouault-2
Daniel,
 
> While upgrading some Python software from using GDAL 2.3 to GDAL 3, I've
> come across this snippet of code:
>
> srs = osr.SpatialReference()
> srs.ImportFromEPSG(102008)
>
> This used to work, but now fails with GDAL 3 / Proj 6 with "crs not found".

yep, we're more pedantic now, and don't mix EPSG and ESRI codes together.

> Projection code 102008 corresponds to "ESRI:102008" described here, which
> the WKT output describes as "EPSG 102008": https://epsg.io/102008

epsg.io should not be taken as a reference website (even if more up-to-date
than spatialreference.org). The WKT you see there has been built by some piece
of software, and is in no way the original ESRI WKT (ESRI WKT has no AUTHORITY
node)

> Is there an easy way to create an SRS from the code 102008 (perhaps with
> some prefix/suffix) in GDAL 3 / PROJ 6? The projection and its code are
> included in the PROJ source data
> (https://github.com/OSGeo/PROJ/blob/master/data/sql/esri.sql), but I can't
> figure out what combination of "ImportFrom..." function and projection code
> format to use.

srs.SetFromUserInput("ESRI:102008")

> (There is a possibility that the GDAL 2.3 build we have has 102008 added
> into the data files - the history of the custom fork of GDAL we're moving
> away from isn't well documented)

No, stock GDAL 2.4 will also output

$ gdalsrsinfo EPSG:102008

PROJ.4 : +proj=aea +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0
+datum=NAD83 +units=m +no_defs

OGC WKT :
PROJCS["North_America_Albers_Equal_Area_Conic",
    GEOGCS["GCS_North_American_1983",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["False_Easting",0.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["longitude_of_center",-96.0],
    PARAMETER["Standard_Parallel_1",20.0],
    PARAMETER["Standard_Parallel_2",60.0],
    PARAMETER["latitude_of_center",40.0],
    UNIT["Meter",1.0],
    AUTHORITY["Esri","102008"]]

This is an arguable convenience that is no longer offered.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Importing ESRI (EPSG?) 102008 in GDAL 3.x/PROJ 6

Daniel Evans-2
Hi Even,

> epsg.io should not be taken as a reference website (even if more up-to-date than spatialreference.org). The WKT you see there has been built by some piece of software, and is in no way the original ESRI > WKT (ESRI WKT has no AUTHORITY node)

Thanks for the note. I was mostly rather confused by whether it was considered an official EPSG code (if such a thing even exists), relegated to being a custom ESRI one with "ESRI" as a prefix, or something totally different.

> srs.SetFromUserInput("ESRI:102008")

That's the magic one-liner I was hoping for. Thanks!


Dr. Daniel Evans
Software Developer


-----Original Message-----
From: Even Rouault <[hidden email]>
Sent: 05 March 2020 16:01
To: [hidden email]
Cc: Daniel Evans <[hidden email]>
Subject: Re: [gdal-dev] Importing ESRI (EPSG?) 102008 in GDAL 3.x/PROJ 6

Daniel,

> While upgrading some Python software from using GDAL 2.3 to GDAL 3,
> I've come across this snippet of code:
>
> srs = osr.SpatialReference()
> srs.ImportFromEPSG(102008)
>
> This used to work, but now fails with GDAL 3 / Proj 6 with "crs not found".

yep, we're more pedantic now, and don't mix EPSG and ESRI codes together.

> Projection code 102008 corresponds to "ESRI:102008" described here,
> which the WKT output describes as "EPSG 102008":
> https://epsg.io/102008

epsg.io should not be taken as a reference website (even if more up-to-date than spatialreference.org). The WKT you see there has been built by some piece of software, and is in no way the original ESRI WKT (ESRI WKT has no AUTHORITY
node)

> Is there an easy way to create an SRS from the code 102008 (perhaps
> with some prefix/suffix) in GDAL 3 / PROJ 6? The projection and its
> code are included in the PROJ source data
> (https://github.com/OSGeo/PROJ/blob/master/data/sql/esri.sql), but I
> can't figure out what combination of "ImportFrom..." function and
> projection code format to use.

srs.SetFromUserInput("ESRI:102008")

> (There is a possibility that the GDAL 2.3 build we have has 102008
> added into the data files - the history of the custom fork of GDAL
> we're moving away from isn't well documented)

No, stock GDAL 2.4 will also output

$ gdalsrsinfo EPSG:102008

PROJ.4 : +proj=aea +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0
+datum=NAD83 +units=m +no_defs

OGC WKT :
PROJCS["North_America_Albers_Equal_Area_Conic",
    GEOGCS["GCS_North_American_1983",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["False_Easting",0.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["longitude_of_center",-96.0],
    PARAMETER["Standard_Parallel_1",20.0],
    PARAMETER["Standard_Parallel_2",60.0],
    PARAMETER["latitude_of_center",40.0],
    UNIT["Meter",1.0],
    AUTHORITY["Esri","102008"]]

This is an arguable convenience that is no longer offered.

Even

--
Spatialys - Geospatial professional services http://www.spatialys.com
T +44 (0) 1756 799919
www.jbarisk.com<http://www.jbarisk.com>

[Visit our website]<http://www.jbarisk.com> [http://www.jbagroup.co.uk/imgstore/JBA-Email-Sig-Icons-LINKEDIN.png] <>  [Follow us on Twitter] <https://twitter.com/jbarisk>
Our postal address and registered office is JBA Risk Management Limited, 1 Broughton Park, Old Lane North, Broughton, Skipton, North Yorkshire BD23 3FD.
Find out more about us here: www.jbarisk.com<http://www.jbarisk.com/> and follow us on Twitter @JBARisk<http://twitter.com/JBARisk> and LinkedIn<https://www.linkedin.com/company/2370847?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A2370847%2Cidx%3A2-1-2%2CtarId%3A1447414259786%2Ctas%3AJBA%20RISK%20MANAGEMENT>

The JBA Group supports the JBA Trust.

All JBA Risk Management's email messages contain confidential information and are intended only for the individual(s) named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system.


JBA Risk Management Limited is registered in England, company number 07732946, 1 Broughton Park, Old Lane North, Broughton, Skipton, North Yorkshire, BD23 3FD, Telephone: +441756799919


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Importing ESRI (EPSG?) 102008 in GDAL 3.x/PROJ 6

Even Rouault-2
> Thanks for the note. I was mostly rather confused by whether it was
> considered an official EPSG code (if such a thing even exists),

The most official thing would be EPSG registry itself (controlled by IOGP).

For example to get the WKT2:2015 definition of EPSG:32631:

https://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::32631

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev