<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Even,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 7, 2019 at 2:13 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Sean,<br>
<br>
> <br>
> I observe a difference between the WKT exports of OSRImportFromEPSG(osr,<br>
> 3857) and OSRImportFromProj4(osr, "+init=epsg:3857"). The former gives a<br>
> named coordinate system, the latter gives an unnamed coordinate system.<br>
> <br>
><br>
> Am I wrong to understand the semantics of "+init=epsg:3857" as "open the<br>
> epsg database, get entry 3857, and use that"? Is this different from<br>
> specifying the entry directly?<br>
<br>
That's an case where my recent work will help reducing the confusion <br>
(hopefully)<br>
In current released versions, OSRImportFromEPSG() read in the GDAL data/*.csv <br>
files a fully-fledged description of the geodetic object.<br>
OSRImportromProj4("+init=epsg:XXXX") goes to PROJ which opens the $prefix/<br>
share/proj/epsg file, identifies the PROJ string in it that corresponds to the <br>
code, returns it to GDAL, and GDAL reconstructs a OGRSpatialReference by <br>
analysing the PROJ4 string, which has no names.<br>
<br>
With the RFC73 related work, now there's a single database. The <br>
+init=epsg:XXXX syntax is still supported as a legacy mechanism by PROJ, but <br>
it no longer opens a 'epsg' file but rather goes to the proj.db database. Note <br>
that for backward compatibility purposes, if you use the +init=epsg:XXXX <br>
syntax, PROJ will return CRS objects with possibly a non-EPSG compliant axis <br>
order (for example it will return longitude-latitude for geographic CRS, <br>
whereas EPSG mandates latitude-longitude). GDAL (with the commit I just pushed <br>
since the +init=epsg:XXXX case was actually broken in master) will now emit a <br>
warning if you use that legacy syntax.<br>
<br>
$ gdalsrsinfo EPSG:4326 -o WKT2<br>
<br>
GEOGCRS["WGS 84",<br>
    DATUM["World Geodetic System 1984",<br>
        ELLIPSOID["WGS 84",6378137,298.257223563,<br>
            LENGTHUNIT["metre",1]]],<br>
    PRIMEM["Greenwich",0,<br>
        ANGLEUNIT["degree",0.0174532925199433]],<br>
    CS[ellipsoidal,2],<br>
        AXIS["geodetic latitude (Lat)",north,<br>
            ORDER[1],<br>
            ANGLEUNIT["degree",0.0174532925199433]],<br>
        AXIS["geodetic longitude (Lon)",east,<br>
            ORDER[2],<br>
            ANGLEUNIT["degree",0.0174532925199433]],<br>
    USAGE[<br>
        SCOPE["unknown"],<br>
        AREA["World"],<br>
        BBOX[-90,-180,90,180]],<br>
    ID["EPSG",4326]]<br>
<br>
vs<br>
<br>
$ gdalsrsinfo +init=epsg:4326 -o WKT2<br>
Warning 1: +init=epsg:XXXX syntax is deprecated. It might return "<br>
a CRS with a non-EPSG compliant axis order.<br>
<br>
GEOGCRS["WGS 84",<br>
    DATUM["World Geodetic System 1984",<br>
        ELLIPSOID["WGS 84",6378137,298.257223563,<br>
            LENGTHUNIT["metre",1]],<br>
        ID["EPSG",6326]],<br>
    PRIMEM["Greenwich",0,<br>
        ANGLEUNIT["degree",0.0174532925199433],<br>
        ID["EPSG",8901]],<br>
    CS[ellipsoidal,2],<br>
        AXIS["longitude",east,<br>
            ORDER[1],<br>
            ANGLEUNIT["degree",0.0174532925199433,<br>
                ID["EPSG",9122]]],<br>
        AXIS["latitude",north,<br>
            ORDER[2],<br>
            ANGLEUNIT["degree",0.0174532925199433,<br>
                ID["EPSG",9122]]],<br>
    USAGE[<br>
        SCOPE["unknown"],<br>
        AREA["World"],<br>
        BBOX[-90,-180,90,180]]]<br>
<br>
In the later, the axis roder is long/lat and the ID["EPSG",4326] node has been <br>
stripped off since the object is not conformant with EPSG.<br></blockquote><div><br></div><div>Thank you for the explanation and the fix. Thanks, too, for the details in <a href="https://trac.osgeo.org/gdal/wiki/rfc73_proj6_wkt2_srsbarn#OGRCoordinateTransformationchanges">https://trac.osgeo.org/gdal/wiki/rfc73_proj6_wkt2_srsbarn#OGRCoordinateTransformationchanges</a> and <a href="https://trac.osgeo.org/gdal/wiki/rfc73_proj6_wkt2_srsbarn#Axisorderissues">https://trac.osgeo.org/gdal/wiki/rfc73_proj6_wkt2_srsbarn#Axisorderissues</a> which make a lot of sense to me and answer all of the follow up questions that came to my mind.</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Sean Gillies</div></div></div></div></div>