[PROJ] Inconsistent WKT1 output

Javier Jimenez Shaw j1 at jimenezshaw.com
Wed Mar 29 12:04:45 PDT 2023


Thanks!

On Wed, 29 Mar 2023 at 20:19, Even Rouault <even.rouault at spatialys.com>
wrote:

> Javier,
>
> yes the conventions are different. PROJ follows (mostly)
> https://docs.ogc.org/is/18-010r7/18-010r7.html#37:
>
> """
>
> Identifier is an optional attribute which references an external
> description of the object and which may be applied to a coordinate
> reference system, a coordinate operation or a bound CRS. It may also be
> utilised for components of these objects although this is recommended only
> for the following circumstances:
>
>    - coordinate operation methods and parameters;
>    - source and target CRSs when embedded within a coordinate
>    transformation or a concatenated coordinate operation;
>    - source CRS when embedded within a point motion operation;
>    - individual coordinate operations embedded within a concatenated
>    coordinate operation;
>    - base CRS when embedded within a derived CRS (including projected
>    CRS);
>    - source CRS, target CRS and abridged transformation when embedded
>    within a bound CRS;
>    - individual members of a datum ensemble.
>
> """
>
> So if the top object has an ID, generally its sub-objects won't have their
> IDs emitted, except the above exceptions (I see we don't emit ids for
> individual members of a datum ensemble. I remember that those exceptions
> have been in flux, so probably this was changed after this was implemented
> in PROJ. anyway I would be inclined to to change that now, as datum
> ensemble are sufficiently verbose as they are)
>
> See
> https://github.com/OSGeo/PROJ/blob/bafe3a91901b4515a8017a6b019e43edb74a0764/src/iso19111/io.cpp#L485
> for the logic. It could be tuned to whatever people fancy for their WKT
> (there's actually a predefined WKT2_SIMPLIFIED variant where there are no
> ids on projection methods and parameters), since the omission of id is a
> convention, and not a hard rule
>
> There's always a bit of "tension" about the appropriate verbosity of WKT:
> should it be a full dump of the (extract of) the underlying geodetic
> database or just a summary with the appropriate level of detail.
>
> Even
> Le 29/03/2023 à 18:46, Javier Jimenez Shaw a écrit :
>
> Hi
>
> Comparing some WKT1 strings I found something strange. If I ask for
> WKT1_GDAL based on an EPSG code, I get the authorities of the spheroid,
> prime and the datum. However, If I use an WKT2 as the input, they are not
> there.
>
> Is that expected?
>
> > projinfo -o wkt1_gdal EPSG:6318
> WKT1:GDAL string:
> GEOGCS["NAD83(2011)",
>     DATUM["NAD83_National_Spatial_Reference_System_2011",
>         SPHEROID["GRS 1980",6378137,298.257222101,
>             AUTHORITY["EPSG","7019"]],
>         AUTHORITY["EPSG","1116"]],
>     PRIMEM["Greenwich",0,
>         AUTHORITY["EPSG","8901"]],
>     UNIT["degree",0.0174532925199433,
>         AUTHORITY["EPSG","9122"]],
>     AUTHORITY["EPSG","6318"]]
>
> > projinfo -o wkt1_gdal "$(projinfo EPSG:6318 -o wkt2_2019 -q)"
> WKT1:GDAL string:
> GEOGCS["NAD83(2011)",
>     DATUM["NAD83_National_Spatial_Reference_System_2011",
>         SPHEROID["GRS 1980",6378137,298.257222101]],
>     PRIMEM["Greenwich",0],
>     UNIT["degree",0.0174532925199433,
>         AUTHORITY["EPSG","9122"]],
>     AUTHORITY["EPSG","6318"]]
>
> Thank
>
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
>
> _______________________________________________
> PROJ mailing listPROJ at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/proj
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230329/8a8d8cd1/attachment.htm>


More information about the PROJ mailing list