opengeospatial / ogcapi-tiles

OGC API - Tiles draft specification
https://ogcapi.ogc.org/tiles
Other
37 stars 18 forks source link

Add `templated` boolean to communicate the tiles object is templated. #16

Closed cholmes closed 4 years ago

cholmes commented 4 years ago

See https://github.com/opengeospatial/OGC-API-Tiles/issues/3#issuecomment-585651139

When we discussed the options for representing URI templates according to RFC 6570 in the Vector Tiles Pilot we came to the conclusion that it would be best to use a link object and add support for expressing this using an additional JSON member to express that the link is not a "clickable link", but a URI template. We followed the approach taken by HAL and added a boolean-valued templated member that defaults to false (HAL, Vector Tiles Pilot Report).

I still think that this is a good approach and what all OGC API Tiles implementations that I have accessed over the last year (e.g. ldproxy, GeoServer, Ecere, CubeWerx) do.

I cannot find templated in the current OGC API Tiles draft though. If that is the case, it is missing and should be added.

joanma747 commented 4 years ago

I like the suggestion and I cannot do any harm accepting it. I will include this in the next draft of the tiles specification.

joanma747 commented 4 years ago

We have a problem with templates: They are not very useful if you do not know the logic of the variables so they are difficult to use in naive clients. Even for a expert it is difficult to use a tile URL and not get a boring "sea" tile (70% of the planent is water). I wonder if we could add a example key for the server to provide a nice example for the tile. An alternative could be to actually to include the example in the href attribute and a template attribute with the actual template.

cholmes commented 4 years ago

I like the example idea, but I think that should be its own ticket as opposed to re-opening this one? The URI used was already a templated one, this was just adding a mechanism to make it clear to a client that this is a template.

I think a clear 'example' tile is better than using an example in the href with a template attribute, since I don't think anyone wants a random tile...

ghobona commented 4 years ago

@joanma747

As suggested by @cholmes, please move the contents of https://github.com/opengeospatial/OGC-API-Tiles/issues/16#issuecomment-619957332 into a new ticket and close this ticket.

joanma747 commented 4 years ago

We have add the "templated"

Decision was href= is a URI template if templated='true'.

joanma747 commented 4 years ago

In MapML they use "tref" to point to a templated href. https://github.com/Maps4HTML/MapML-Proposal

This is not json but an html extension but I believe is equally relevant. I'm still not convinced that is it a good idea to have a URI template in href.

Joan

cportele commented 4 years ago

I understand the concern, but from a processing perspective there is no difference between a tref attribute and href with templated=true. In both cases we classify something as a link that isn't a link until the template parameters are resolved/replaced and provide a mechanism how to detect this.

tref has been invented by MapML, if I am not mistaken, and templated comes from HAL. I would say that we either leave it as it is or do not use a Link object for the templates at all (i.e., the templates wouldn't be in the links array).

joanma747 commented 4 years ago

the templates wouldn't be in the links array

This is not a good alternative. It will complicate the "follow the links" approach. so I prefer the "leave it as it is" alternative.

(Note that I was not reopening the issue (that remains closed for now). I have just found another place were they have the same problem and adopted a similar but different solution and I wanted to document it. Sorry if I was insisting on my preferences simultaneously. I should not do that at this stage. I confirm "tref" is a solution invented by MapML)