Skip to content

Conversation

@hrodmn
Copy link
Contributor

@hrodmn hrodmn commented Jan 10, 2026

This notebook shows how to generate a STAC item and associated catalog.json in a DPS algorithm and how to use the resulting STAC metadata via the DPS STAC API and the attached titiler instance.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,4059 @@
{
Copy link
Collaborator

@HarshiniGirish HarshiniGirish Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we run rio_stac.create_stac_item(...), it may populate the asset href as an absolute local filesystem path (e.g., /tmp/output/demo.tif). That can look fine inside the notebook, but once DPS uploads outputs to S3 and the STAC is ingested, that local path doesn’t exist anymore, so STAC API/tiler clients can’t resolve the asset.maybe we can write asset hrefs to be relative to the STAC JSON location set assets.*.href to something like demo.tif (or ./demo.tif) before writing item.json / catalog.json. This can keeps the STAC portable after upload. (not sure)


Reply via ReviewNB

@@ -0,0 +1,4059 @@
{
Copy link
Collaborator

@HarshiniGirish HarshiniGirish Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid setting self_href to /tmp/output/.... Keep it relative (e.g., item.json) or let normalize_and_save(...) set it, so the STAC stays portable


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok to define asset + item hrefs as absolute paths at this point. After we have created the entire catalog we convert the hrefs to relative paths before writing the STAC metadata to json files.

@@ -0,0 +1,4059 @@
{
Copy link
Collaborator

@HarshiniGirish HarshiniGirish Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #9.            "grade": "A+",  # you can add any relevant attributes/tags here!

maybe setting properties={"grade": "A+"} works, but it’s safer to namespace custom fields so they don’t clash with future STAC extensions.


Reply via ReviewNB

@@ -0,0 +1,4059 @@
{
Copy link
Collaborator

@HarshiniGirish HarshiniGirish Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #10.        roles=["data"],

both assets are ["data"] consider differentiating ?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The roles assignments for a STAC asset just refer to the type of asset so it's ok for multiple assets to share the data tag. Alternatives include metadata to describe non-data files.

@HarshiniGirish
Copy link
Collaborator

@hrodmn I finished the review. I left a few minor suggestions. Nothing blocking, so feel free to ignore any of them if they don’t fit your intended flow.

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