natcap / geometamaker

https://geometamaker.readthedocs.io/en/latest/
Apache License 2.0
2 stars 1 forks source link

Record min/max values for raster bands #15

Open davemfish opened 6 months ago

davemfish commented 6 months ago

This is part of content_info in the MCF spec:

dimensions:
    type: array
    items:
        type: object
        properties:
            name:
                type: string
                description: name of dimension
            units:
                type: string
                description: units in which sensor wavelengths are expressed
            min:
                type: number
                description: shortest wavelength that the sensor is capable of collecting within a designated band
            max:
                type: number
                description: longest wavelength that the sensor is capable of collecting within a designated band
        required:
            - name
            - units
            - min
            - max

Given these descriptions, it's not clear that this is relevant info for most rasters that we work with. But @empavia suggested that min/max could hold the min & max pixel values, and that does seem like useful metadata. Although those stats would pertain to each band, so maybe there is actually a different place for them in the attributes section of content_info:

values:
    type: object
    oneOf:
        - properties:
              enum:
                  type: array
                  description: enumerated list of values
                  minItems: 1
                  items:
                      $ref: '#/definitions/any_type'
        - properties:
              range:
                  type: array
                  description: range of values (min/max)
                  minItems: 2
                  maxItems: 2
                  items:
                      $ref: '#/definitions/any_type'
        - properties:
              codelist:
                  type: array
                  description: values from a codelist
                  minItems: 1
                  items:
                      type: object
                      properties:
                          name:
                              type: string
                              description: value name
                          title:
                              $ref: '#/definitions/i18n_string'
                              description: human readable title of value
                          abstract:
                              $ref: '#/definitions/i18n_string'
                              description: description of value
                          url:
                              $ref: '#/definitions/i18n_string'
                              description: URL with more information about the value
                      required:
                              - name
davemfish commented 6 months ago

If we think this is useful for raster bands, should we also be supporting it for vector fields?

davemfish commented 1 month ago

As of #24 we no longer need to figure out where in the MCF schema this should go, but we certainly consider adding it to the BandSchema.

Finding min/max values could be expensive for large datasets.

empavia commented 1 month ago

As of #24 we no longer need to figure out where in the MCF schema this should go, but we certainly consider adding it to the BandSchema.

Finding min/max values could be expensive for large datasets.

As time goes on, and as I curate more data, the less this may be relevant for the YAML. It may still be useful for people in some cases, however an aux.xml file may contain the relevant info and that may be included instead. Otherwise, a quick use of gdal info could get people the information they would need.