Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added stac title if in metadata #517

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

clausmichele
Copy link
Contributor

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
Copy link

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
Copy link

codecov bot commented Feb 24, 2023

Codecov Report

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

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

❗ 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
@@             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 Coverage Δ
cubedash/summary/_model.py 79.77% <0.00%> (ø)
cubedash/summary/_schema.py 80.67% <ø> (ø)
cubedash/_stac.py 86.22% <66.66%> (-0.16%) ⬇️
cubedash/_model.py 96.06% <100.00%> (+0.06%) ⬆️
cubedash/_pages.py 88.07% <100.00%> (+0.04%) ⬆️
cubedash/generate.py 85.35% <100.00%> (+0.18%) ⬆️
cubedash/summary/_stores.py 92.22% <100.00%> (ø)
cubedash/summary/_summarise.py 96.15% <100.00%> (+0.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@clausmichele
Copy link
Contributor Author

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

@omad omad requested review from omad, jeremyh and Ariana-B March 9, 2023 05:42
@pindge pindge merged commit cf53808 into opendatacube:develop Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants