xcube-dev / xcube

xcube is a Python package for generating and exploiting data cubes powered by xarray, dask, and zarr.
https://xcube.readthedocs.io/
MIT License
201 stars 20 forks source link

STAC: support domain and range #916

Closed pont-us closed 10 months ago

pont-us commented 10 months ago

Describe the bug

The OGC STAC / collections API doesn't provide domain set grid data or a range type schema. The grid can be defined by extending the existing extent object in the collection description. Example:

  "extent" : {
      "spatial" : {
         "bbox" : [ [ -180, -90, 180, 90 ] ],
         "grid" : [
            {
               "cellsCount" : 1024,
               "resolution" : 0.3515625
            },
            {
               "cellsCount" : 512,
               "resolution" : 0.3515625
            }
         ]
      },
      "temporal" : {
         "interval" : [ [ "2015-12-30", "2025-12-26" ] ],
         "grid" : {
            "cellsCount" : 3650,
            "resolution" : "P1D"
         }
      },
      "pressure" : {
         "crs" : "http://www.opengis.net/def/crs/OGC/0/barometric",
         "interval" : [
            [ 1000.0, 10.0 ]
         ],
         "grid" : {
            "cellsCount" : 8,
            "coordinates" : [ 1000.0, 850.0, 700.0, 500.0, 250.0, 100.0, 50.0, 10.0 ]
         }
      }
   },

The range type should be provided as a JSON schema at an additional /schema endpoint under the collection identifier. Example:

{
   "$schema" : "https://json-schema.org/draft/2020-12/schema",
   "$id" : "https://maps.gnosis.earth/ogcapi/collections/windSpeed/schema",
   "title" : "Wind Velocity",
   "type" : "object",
   "properties" : { "ua" : {
      "title" : "Eastward Wind",
      "type" : "number",
      "x-ogc-property-seq" : 1
   }, "va" : {
      "title" : "Northward Wind",
      "type" : "number",
      "x-ogc-property-seq" : 2
   } }
}