Open vincentsarago opened 8 months ago
Bonjour Vincent,
IMO using wkt attribute to expect a PROJJSON object is pretty confusing because in wkt there is the word text
I strongly agree with this. However, unfortunately, I believe the WKT-CRS standard, as it is referred to ( https://docs.ogc.org/is/18-010r11/18-010r11.pdf ) currently acts as both a logical & conceptual model as well specifically the WKT encoding for the CRS.
The intent in 2DTMS was that this would be a JSON object, as defined once the OGC CRS SWG approves a proper JSON encoding for the WKT-CRS conceptual & logical model. In the meantime, the recommendation is to use PROJJSON in a provisional manner.
There is a note to that effect in 7.1:
NOTE This Standard adopts the https://proj.org/specifications/projjson.html encoding, pending a resolution in the CRS group for adopting a possible future JSON encoding for WKT for CRS 2.0
and the table above says:
WKT object The WKT encoding for JSON is an object representing a JSON encoding of the WKT for CRS 2.0 defined by https://proj.org/specifications/projjson.html
Again, I fully agree and dislike that something not text is called WKT
, but this is how things have been defined so far by the CRS group.
There is even confusion between the WKT encoding for simple features vs. the WKT CRS.
EDIT: Probably we could have used something else than wkt
as the attribute name, but changing it at this point would be a breaking change that would require a major version bump.
😬 well I just realized that PROJJSON is of type text
(because json is of type text) 🤦
It's just confusing about wkt/projjson. Maybe it would be nice to really mention that it's should be PROJJSON string.
@vincentsarago To be clear, it should be a PROJJSON object, not some JSON inside a "" string.
ok ok 🙏
I'll update my libraries accordingly, thanks @jerstlouis
@vincentsarago And in general, if a registered URI exists, the uri
approach should be used, which avoids having to parse the CRS definition when it can easily be recognized by string-comparing the URI, which is likely to be more widely supported by clients.
@jerstlouis sure I'm just trying to follow the specification to the letter to win the OGC TMS2.0
badge 😄
in the schema it says the the wkt should be an object of type PROJJSON
https://github.com/opengeospatial/2D-Tile-Matrix-Set/blob/7cee2f8cd03b07bf457683321747be41d10abe66/schemas/tms/2.0/json/crs.json#L26-L38
but in https://docs.ogc.org/is/17-083r4/17-083r4.html#toc13 it says that the datatype is
Any
In the OGC Tiles API the schema says it should be an object (no PROJJSON type mentioned)
https://github.com/opengeospatial/ogcapi-tiles/blob/2961beeaca21e5db5f3f558dcd48c8e775061a45/openapi/schemas/common-geodata/crs.yaml#L15-L20
IMO using
wkt
attribute to expect a PROJJSON object is pretty confusing because inwkt
there is the wordtext
🤷.in
epsg.io
orspatialreference.org
the representation for PROJJSON is defined withjson
while theogc wkt (2)
use text. InProj
if you useto_wkt
you get a string and to get a PROJJSON you useto_json