Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Providing multiple representations of the same coverage at different resolutions #75

Closed
jonblower opened this issue Jul 22, 2016 · 2 comments

Comments

@jonblower
Copy link
Member

In the discussion about Tiling (#29) we started talking about the problem of how to handle large coverages, raising the question of how we could provide the client with different views of the coverage at different resolutions, for greater efficiency and scalability. There are several possible solutions:

  1. Link the coverage to an API that performs subsetting on the fly
  2. Provide multiple versions of the range within the coverage (e.g. one version for each resolution or zoom level).
  3. Create a special kind of Coverage Collection that collects together different versions of (what is notionally) the same coverage.

Option 1 is of course possible (and is already done in the OPeNDAP world) but I feel that we should have an alternative that doesn't require running a dynamic server. I think we rejected option 2 in the discussion of #29 because it can break the domain-range contract. Option 3 is probably the preferred option. This ticket is to develop that proposal.

I think the mechanism @letmaik proposed in #29 is OK, and I'll reproduce it here:

{
  "type" : "CoverageCollection",
  "domainType": "Grid",
  "referencing": [{
    "components": ["x","y"],
    "system": {
      "type": "GeodeticCRS",
      "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"        
    }
  }, {
    "components": ["t"],
    "system": {
      "type": "TemporalRS",
      "calendar": "Gregorian"
    }
  }],
  "parameters" : {
    "air_temp": {
      "type" : "Parameter",
      "description" : {
        "en": "The air temperature measured in degrees Celsius."
      },
      "unit" : {
        "label": {
          "en": "Degree Celsius"
        },
        "symbol": {
          "value": "Cel",
          "type": "http://www.opengis.net/def/uom/UCUM/"
        }
      },
      "observedProperty" : {
        "id" : "http://vocab.nerc.ac.uk/standard_name/air_temperature/",
        "label" : {
          "en": "Air temperature",
          "de": "Lufttemperatur"
        }
      }
    }
  },
  "coverages": [{
    "type" : "Coverage",
    "domain" : {
      "type": "Domain",
      "axes": {
        "x": { "start": -179.5, "stop": 179.5, "num": 360 },
        "y": { "start": -89.5, "stop": 89.5, "num": 180 },
        "t": { "values": ["2016-01-01T00:00:00Z", "2016-01-01T06:00:00Z"] }
      }
    },
    "ranges" : {
      "air_temp" : {
        "type": "TiledNdArray",
        "axisNames": ["t","y","x"],
        "shape": [2, 180, 360],
        "tileSets": [{
          "tileShape": [1, 60, 60],
          "urlTemplate": "http://example.com/weather/temperature/0/{t}/{x}/{y}.covjson"
        }]
      }
    }
  }, {
    "type" : "Coverage",
    "domain" : {
      "type": "Domain",
      "axes": {
        "x": { "start": -179.5, "stop": 179.5, "num": 720 },
        "y": { "start": -89.5, "stop": 89.5, "num": 360 },
        "t": { "values": ["2016-01-01T00:00:00Z", "2016-01-01T06:00:00Z"] }
      }
    },
    "ranges" : {
      "air_temp" : {
        "type": "TiledNdArray",
        "axisNames": ["t","y","x"],
        "shape": [2, 360, 720],
        "tileSets": [{
          "tileShape": [1, 60, 60],
          "urlTemplate": "http://example.com/weather/temperature/1/{t}/{x}/{y}.covjson"
        }]
      }
    }
  }, {
    "type" : "Coverage",
    "domain" : {
      "type": "Domain",
      "axes": {
        "x": { "start": -179.5, "stop": 179.5, "num": 1440 },
        "y": { "start": -89.5, "stop": 89.5, "num": 720 },
        "t": { "values": ["2016-01-01T00:00:00Z", "2016-01-01T06:00:00Z"] }
      }
    },
    "ranges" : {
      "air_temp" : {
        "type": "TiledNdArray",
        "axisNames": ["t","y","x"],
        "shape": [2, 720, 1440],
        "tileSets": [{
          "tileShape": [1, 60, 60],
          "urlTemplate": "http://example.com/weather/temperature/2/{t}/{x}/{y}.covjson"
        }]
      }
    }
  }]
}
@jonblower
Copy link
Member Author

Possible improvements:

  1. Should there be some metadata to indicate the type of collection we have here (i.e. multiple versions of the same coverage)? Maybe the type could be called a "pyramid" or something, borrowing the term from "image pyramid".
  2. Could we also allow the full-resolution coverage to be published on its own, with a link back to this Collection? In that way a client could start by loading the coverage metadata, then find out automatically whether a "pyramid" option is available if it decides it can't load the whole coverage. Something like this:
{
    "type" : "Coverage",
    "alternativeRepresentations": [{
        "id": "http://myserver.com/data/CoverageAsPyramid",
        "type:" "CoveragePyramid"
     }],
    "domain" : { 
      // Full-res domain
    },
    "parameters" : {
    },
    "ranges" : {
      // Full-res range objects
    }
}

@letmaik
Copy link
Member

letmaik commented Feb 18, 2022

This seems quite useful, though my guess is that in most environments it is actually the server doing the subsetting and CovJSON is just a mechanism to get the data across. In any case, this is easily doable in a future version in a backwards-compatible way, so I'm going to close this and wait until someone has a concrete need for it that can drive the discussion.

@letmaik letmaik closed this as completed Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants