covjson / specification

CoverageJSON specification
https://covjson.org/spec/
45 stars 6 forks source link

Additional alternative range formats (e.g. OPeNDAP, (Geo)TIFF) #72

Closed letmaik closed 8 years ago

letmaik commented 8 years ago

This is a continuation of #44. Through internal discussion and feedback from outside, the request for alternative range formats comes up quite a lot, especially with the use case of integrating CovJSON into existing infrastructures. So we should support that in an easy way that doesn't affect JSON-only clients and doesn't rely on content negotiation (since this is not always available).

The following is a copy of an email of mine:

The idea is that the current "ranges" property stays as it is but we add a new one called "rangeAlternates" (coming from the Link relation type "alternate") which would look like that:

"ranges" : {
  "TEMP" : "http://example.com/TEMP.covjson"
},
"rangeAlternates": {
  "uor:dap2": {
    "TEMP": {
      "type": "uor:DAP2NdArray",
      "dataType": "float",
      "axisNames": ["y","x"],
      "shape": [180, 360],
      "uor:offset": 40,
      "uor:factor": 100,
      "uor:missingValue": 999,
      // or:
      // "uor:validMin": 0,
      // "uor:validMax": 50,
      "urlTemplate": "http://my.opendap.server/data.dods?air_temp{y}{x}"
    }
  },
  "uor:tiff": {
    "TEMP": {
      "type": "uor:TIFF2DArray",
      "dataType": "float",
      "axisNames": ["y","x"],
      "shape": [180, 360],
      "uor:channel": 0,
      "url": "http://example.com/data.tiff"
    }
  }
}

Some details:

Regarding the spec, the only things to do would be to make it clear that "ranges" can actually be empty, and to define the optional "rangeAlternates" property. The spec wouldn't define any of those alternative range formats, that's purely done via extensions.

@jonblower agreed to the above plan.

letmaik commented 8 years ago

I just had the idea of naming the field "alternateRanges" which I think matches the "ranges" field a bit better than "rangeAlternates". Should we use that?

jonblower commented 8 years ago

Yes, alternateRanges maybe sounds a bit better. My only worry is that this might make it sound like this is "alternative data" rather than "the same data in an alternative format". But maybe I'm worrying too much.

letmaik commented 8 years ago

Hm... I think you're right. The initial one makes more sense semantically. An analogy could be a user profile image which exists in several formats. Then calling it profileImageAlternates makes slightly more sense then alternateProfileImages.