stac-extensions / raster

Describes raster assets at band level (one or multiple) with specific information such as data type, unit, number of bits used, nodata.
Apache License 2.0
13 stars 7 forks source link

Various suggestions #4

Closed m-mohr closed 3 years ago

m-mohr commented 3 years ago

Various suggestions copied over from gitter:

Some thoughts:

  1. see #3
  2. see #1
  3. see #3
  4. Band math needs to be better defined. Like what operations and functions are allowed?
  5. see #2
  6. Let's remove raster specific things from file and clarify what should be in file and what in raster ;-)
  7. I think it's a bad idea to define the values as they are and would prefer to make them like they are in file. I think the key as description can lead to conflicts. We have the case where we would have something like:
    {
    "land": 0,
    "land": 1,
    "ocean": 2
    }

    Duplicates in object keys don't really work...

  8. I'm also a bit confused about the "from" in the Value object and would need a clarification
emmanuelmathot commented 3 years ago

some answers:

  1. yes, it definitively needs a proper reference. For the moment, the baseline is the rio-tiler expression. From https://observablehq.com/@vincentsarago/the-power-of-rio-tiler-expression, it seems to be based on python numexpr: https://github.com/pydata/numexpr
  2. IMO, this is the discussion about asset granularity in #3. Behind the raster extension proposal, there is the need to put metadata at band level
  3. I agree on that one. I wanted a way to avoid duplicates. Not sure, you can constraint no field duplication in an array of objects
  4. from field basically allows chaining several values (e.g. DN -> TOA radiance -> TOA reflectance)
m-mohr commented 3 years ago
  1. Would the file:values specification for for you?

Example:

[
    {"value": [0], "summary": "clear"},
    {"value": [1,2], "summary": "clouds"}
]
  1. A clarification in the extension itself would be good to have.
emmanuelmathot commented 3 years ago

For 7., I am not sure to understand what you propose. From file extension, I understand you describe each layer. Here you can describe several times the same band with different values. For instance, for typical remote sensing optical sensor the pixel can represent either the raw energy (DN), a TOA radiance or even a reflectance. Using what you propose, it would give something like:

"raster:bands": [
        {
          "values": [
            {
              "name": "TOA radiance",
              "unit": "W⋅sr−1⋅m−2⋅nm−1",
              "scale": 0.01,
              "offset": 0
            },{
              "name": "TOA reflectance",
              "scale": 0.0000185074513929,
              "offset": 0
            }]
          }]
m-mohr commented 3 years ago

For 7: I'm just proposing to take over the object schema from file for file:values. But it seems values actually is something different in your case. In your case it describes the values, while in my case it lists the possible values (e.g. for masks).

emmanuelmathot commented 3 years ago

@m-mohr I changed the values as array, does that look like what you had in mind?

emmanuelmathot commented 3 years ago

Discussed in meetup and transferred in #10.