opengeospatial / ogcapi-maps

OGC API - Map draft specification
https://ogcapi.ogc.org/maps
Other
53 stars 16 forks source link

How to know that a collection of a collectionId is available as a map or tiles? #5

Closed joanma747 closed 4 years ago

joanma747 commented 5 years ago

https://github.com/opengeospatial/WFS_FES defines that a collection of features can be retrieved as a geojson.

GET /collections/{collectionId}

Assuming that we can "convert" this FeatureCollection into a map by adding

GET /collections/{collectionId}/map...

How can we know that a map (or tiles) are available for this collection?. We cannot write this in the API description because it will affect all resources offered by the API. We cannot specify it in the response of /collections/{collectionId} because the format of it is governed by WFS people.

Options

joanma747 commented 5 years ago

For the moment the suggested procedure is to add the list of CRS or/and tileMatrixSets the collection is available as map or tile in the GET of "'/collections/{collectionId}'" The exact parameter name is: "mapCRSSetLink" and "tileMatrixSetLink". See the example below.

Of course you can always try if it works and you will get a 404 as a response of a combination that is not possible.

use the "links" in the response of the collection metadata This will require to enumerate all supported CRS as links to maps. In GeoSever (that supports thousands of CRSs) will be a disaster.

OPTIONS /collections/{collectionId} ? This will require a content negotiation based on the headers. this is possible but...

"mapCRSSetLink": [
    {
      "id": "CRS:84",
      "links": [
        {
          "href": "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
          "type": "application/xml",
          "rel": "describedby"
        }
      ]
    }
  ],
  "tileMatrixSetLink": [
    {
      "id": "WebMercatorQuad",
      "links": [
        {
          "href": "https://example.com/api/1.0/tileMatrixSet/WebMercatorQuad?f=ogc-tms-1-0",
          "type": "application/vnd.ogc-tms-1-0.tms+json",
          "rel": "tileMatrixSet"
        }
      ]
    }
  ],
bradh commented 5 years ago

I would expect that a hypermedia-aware client would be checking the results of /collection to find the available collection links. As an example of a WFS3 case, see: https://demo.pygeoapi.io/master/collections?f=json

If the mime type for the link (type=) is "application/geo+json" then I'm willing to treat it as a features collection in geojson.

If the mime type for the link is "image/png" or "image/jpeg" then it looks like a raster or raster tileset. If its "application/vnd.mapbox-vector-tile" then its probably mapbox-stype vector tiles.

Registering and using different mime types might be be useful, but as long as I know what I'm matching against, its mostly an opaque identifier.

joanma747 commented 4 years ago

This is fixed long time ago.