opendatacube / datacube-explorer

Web-based exploration of Open Data Cube collections
Apache License 2.0
56 stars 31 forks source link

added stac title if in metadata #517

Closed clausmichele closed 1 year ago

clausmichele commented 1 year ago

Currently the title field was just a replica of the id field in the STAC metadata. This PR would add the possibility to define a title for a ODC product and view it in the STAC metadata.

Sample product/dataset definition showing how to include a title:

product.yaml

name: vhi_clone
description: The Vegetation Health Index (VHI) is based on a combination of products extracted from vegetation signals, namely the Normalized Difference Vegetation Index (NDVI) and the land surface temperature, both derived from MODIS satellite data. The NDVI is based on 8 day maximum value composite MOD09Q1 (v006) reflectance and the land surface temperature (LST) on 8 day MOD11A2 (v006) LST products. The spatial resolution is 231 m, therefore the original 1000 m resolution of the MOD11A2 LST is downscaled to 231 m of the MOD09Q1 reflectance. Both products are masked to the highest quality standards using the provided quality layers. Missing pixel values in the time series are linearly interpolated. Non-vegetated areas are masked using the most recent Corine Land Cover product version for the according year. The final product is regridded to the LAEA Projection (EPSG:3035). The VHI relies on a strong inverse correlation between NDVI and land surface temperature, since increasing land temperatures are assumed to act negatively on vegetation vigour and consequently to cause stress. The data is provided as 8 day measures. The time series is starting from 2001. The VHI values range from 0-100, whereas high values correspond to healthy vegetation and low values indicate stressed vegetation.
metadata_type: eo3

license: CC-BY-4.0

metadata:
  product:
    name: 8d_vhi
  title: Vegetation Health Index - 231 m 8 days

load:
  crs: EPSG:3035
  resolution: 
    x: 231.656358262999987
    y: -231.656358263001010
  align:
    x: 212.31067014019936
    y: 140.55886972369626
measurements:
  - name: 8d_vhi
    dtype: "uint8"
    units: "1"
    nodata: 255

dataset.yaml

$schema: https://schemas.opendatacube.org/dataset
crs: EPSG:3035
grids:
  default:
    shape: [3606, 4430]
    transform: [231.656358263, 0.0, 3829491.91275753, 0.0, -231.656358263001, 3051286.45355171,
      0.0, 0.0, 1.0]
id: fe9c2536-4b99-4011-b2e0-b00844f9c62f
lineage: {}
measurements:
  8d_vhi: {path: vhi_8d_doy2016321_231m_laea.tif}
product: {name: 8d_vhi}
title: Vegetation Health Index - 231 m 8 days
properties: {datetime: 2016-11-16 00:00:00+00:00, odc:file_format: GeoTIFF}

output stac metadata from the explorer:

{
  "type": "Collection",
  "id": "vhi_clone",
  "stac_version": "1.0.0",
  "description": "The Vegetation Health Index (VHI) is based on a combination of products extracted from vegetation signals, namely the Normalized Difference Vegetation Index (NDVI) and the land surface temperature, both derived from MODIS satellite data. The NDVI is based on 8 day maximum value composite MOD09Q1 (v006) reflectance and the land surface temperature (LST) on 8 day MOD11A2 (v006) LST products. The spatial resolution is 231 m, therefore the original 1000 m resolution of the MOD11A2 LST is downscaled to 231 m of the MOD09Q1 reflectance. Both products are masked to the highest quality standards using the provided quality layers. Missing pixel values in the time series are linearly interpolated. Non-vegetated areas are masked using the most recent Corine Land Cover product version for the according year. The final product is regridded to the LAEA Projection (EPSG:3035). The VHI relies on a strong inverse correlation between NDVI and land surface temperature, since increasing land temperatures are assumed to act negatively on vegetation vigour and consequently to cause stress. The data is provided as 8 day measures. The time series is starting from 2001. The VHI values range from 0-100, whereas high values correspond to healthy vegetation and low values indicate stressed vegetation.",
  "links": [
    {
      "rel": "root",
      "href": "http://0.0.0.0:9000/stac",
      "type": "application/json",
      "title": "Default ODC Explorer instance"
    },
    {
      "rel": "self",
      "href": "http://0.0.0.0:9000/stac/collections/vhi_clone"
    },
    {
      "rel": "items",
      "href": "http://0.0.0.0:9000/stac/collections/vhi_clone/items"
    },
    {
      "rel": "child",
      "href": "http://0.0.0.0:9000/stac/catalogs/vhi_clone/2016-11"
    }
  ],
  "stac_extensions": [],
  "title": "Vegetation Health Index - 231 m 8 days",
  "extent": {
    "spatial": {
      "bbox": [
        [
          3.080800333295437,
          42.841014591998366,
          17.523924303829347,
          50.36459883616284
        ]
      ]
    },
    "temporal": {
      "interval": [
        [
          "2016-11-16T00:00:00Z",
          "2016-11-16T00:00:00Z"
        ]
      ]
    }
  },
  "license": "CC-BY-4.0",
  "providers": []
}
SpacemanPaul commented 1 year ago

You correctly note that the title would need to be added to every dataset under the product as well.

I see no other obvious impediments to merging this PR.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 92.59% and project coverage change: +0.01 :tada:

Comparison is base (dc13cc3) 86.48% compared to head (e093faf) 86.49%.

:exclamation: Current head e093faf differs from pull request most recent head 3350818. Consider uploading reports for the commit 3350818 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #517 +/- ## =========================================== + Coverage 86.48% 86.49% +0.01% =========================================== Files 26 26 Lines 3434 3444 +10 =========================================== + Hits 2970 2979 +9 - Misses 464 465 +1 ``` | [Impacted Files](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube) | Coverage Δ | | |---|---|---| | [cubedash/summary/\_model.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvc3VtbWFyeS9fbW9kZWwucHk=) | `79.77% <0.00%> (ø)` | | | [cubedash/summary/\_schema.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvc3VtbWFyeS9fc2NoZW1hLnB5) | `80.67% <ø> (ø)` | | | [cubedash/\_stac.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvX3N0YWMucHk=) | `86.22% <66.66%> (-0.16%)` | :arrow_down: | | [cubedash/\_model.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvX21vZGVsLnB5) | `96.06% <100.00%> (+0.06%)` | :arrow_up: | | [cubedash/\_pages.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvX3BhZ2VzLnB5) | `88.07% <100.00%> (+0.04%)` | :arrow_up: | | [cubedash/generate.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvZ2VuZXJhdGUucHk=) | `85.35% <100.00%> (+0.18%)` | :arrow_up: | | [cubedash/summary/\_stores.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvc3VtbWFyeS9fc3RvcmVzLnB5) | `92.22% <100.00%> (ø)` | | | [cubedash/summary/\_summarise.py](https://codecov.io/gh/opendatacube/datacube-explorer/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube#diff-Y3ViZWRhc2gvc3VtbWFyeS9fc3VtbWFyaXNlLnB5) | `96.15% <100.00%> (+0.10%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatacube)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

clausmichele commented 1 year ago

@SpacemanPaul is there something preventing the merge of this PR?