Skip to content

Broken paths to accessories after indexing STAC files with relative asset paths #2502

@pjonsson

Description

@pjonsson

Datacube 1.9.20 with the postgis driver.

Doing datacube dataset add /home/ubuntu/test/stac_item.json with a stac_item.json that looks like this:

  "assets": {
    "overview": {
      "href": "overview.jpg",
      "type": "image/jpeg",
      "title": "Overview",
      "description": "Overview",
      "roles": [
        "thumbnail"
      ]
    },
    "B02": {
      "href": "B02.tif",
      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
      "description": "BLUE",
      "raster:bands": [
        { ... }
      ]
    },
  }

results in this database content:

datacube=# select * from odc.dataset where id='<uuid>';
...  "accessories": {"overview": {"path": "overview.jpg"} ... "measurements": {"B02": {"path": "file:///home/ubuntu/test/B02.tif"},

and that gives Explorer faulty paths for the accessories in the information presented for the dataset in https://<explorer-instance>/products/<product-name>/datasets/<uuid>.

I'm not sure where the "path normalization" is done for relative paths of measurements when indexing STAC files, but the same logic should probably apply to accessories with relative paths as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions