opengeospatial / 2D-Tile-Matrix-Set

OGC 2D Tile Matrix Set & TileSet Metadata standard
https://www.ogc.org/standards/tms
Apache License 2.0
8 stars 10 forks source link

Stable URL for tile matrix sets #83

Open tschaub opened 1 year ago

tschaub commented 1 year ago

The tile matrix set registry links to pages describing each of the registered tile matrix sets. For example, WebMercatorQuad is described here: https://defs.opengis.net/vocprez/object?uri=http%3A//www.opengis.net/def/tilematrixset/OGC/1.0/WebMercatorQuad. This page links to GitHub for the actual tile matrix set definition: https://raw.githubusercontent.com/opengeospatial/2D-Tile-Matrix-Set/master/registry/json/WebMercatorQuad.json

This URL includes the name of the default branch (master). So if this repo ever decides to update the name of the default branch (e.g. to main), then the URL above will no longer resolve to the tile matrix set definition. An improvement would be to make use of git tags for releases. Then there would be a URL for the tag that would be stable. For example https://raw.githubusercontent.com/opengeospatial/2D-Tile-Matrix-Set/v2.0.0/registry/json/WebMercatorQuad.json if this repo used tags and had tagged v2.0.0.

It feels like it would also be a good idea for things like the definition for tile matrix sets in OGC's registry to be hosted by OGC instead of by GitHub. One benefit of using GitHub is that it is CORS-enabled (e.g. responses include access-control-allow-origin: *). The ogc.org hosted resources I've seen are not CORS-enabled. So it would only make sense to move the definitions to ogc.org if 1) they used https and 2) they were CORS-friendly.

jerstlouis commented 1 year ago

@tschaub

It feels like it would also be a good idea for things like the definition for tile matrix sets in OGC's registry to be hosted by OGC instead of by GitHub.

Fully agreed, the intent of the GitHub registry was only to provide a source of content maintained by the Tiles SWG that the OGC definition server could host and pull from.

I hope that the Naming Authority can eventually set up the definition server to directly return the content via content negotiation from http://www.opengis.net/def/tilematrixset/OGC/1.0/WebMercatorQuad.

At the moment it redirects (rather than directly return) to application/ld+json SKOS content instead of the actual 2D Tile Matrix Set definition which is what Tiles and other 2DTMS implementations care about.

See e.g., https://github.com/opengeospatial/NamingAuthority/issues/109 (that was closed), https://github.com/opengeospatial/NamingAuthority/issues/198 and https://github.com/opengeospatial/NamingAuthority/issues/203

cc @ghobona @avillar

tschaub commented 1 year ago

I hope that the Naming Authority can eventually set up the definition server to directly return the content via content negotiation from http://www.opengis.net/def/tilematrixset/OGC/1.0/WebMercatorQuad.

Keep in mind that if a web page is hosted via https, a script on that page cannot generally read http resources (they cannot even follow the redirect). So redirecting from http to https might be nice for some things, but it is not a solution for a browser-based web app.

I mentioned this above, but the GitHub URLs are preferable to the OGC ones in that they use https (without redirect). The downside of the GitHub URLs is that they are not currently stable (they would be if they used tag names instead of branch names).

jerstlouis commented 1 year ago

@tschaub I strongly believe that the OGC definition server, at least for the 2DTMS register, should not re-direct, for that reason and several others, not the least of which is the incredibly confusing URLs being redirected to, different from the canonical URI and containing /vocprez/object?uri=, when trying to discover, validate and share TileMatrixSet URIs. That was the essence of https://github.com/opengeospatial/NamingAuthority/issues/109 .

I also believe that the OGC definition server should support https and understand the URIs as equivalent to the http ones. That seems to be the road ahead as per https://github.com/opengeospatial/NamingAuthority/issues/108#issuecomment-983587226 .

Also note that OGC API - Tiles server implementations are still encouraged to host their own local definitions of the 2D Tile Matrix Sets, so as not to be reliant at all on the external OGC definition server. Not for the TileSet "tileMatrixSetURI" and TileMatrixSet "uri" keys, but for the definitions linked to by "rel": "http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme".

Clients can also hardcode or bundle the registered definitions and recognize them by URI string comparison if they wish to avoid extra server roundtrips.