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

Add thumbnail assets to production collections #143

Open
5 tasks done
anayeaye opened this issue Jun 7, 2024 · 5 comments
Open
5 tasks done

Add thumbnail assets to production collections #143

anayeaye opened this issue Jun 7, 2024 · 5 comments
Assignees

Comments

@anayeaye
Copy link
Contributor

anayeaye commented Jun 7, 2024

What

We now have a bucket in MCP s3://veda-thumbnails that is publicly accessible via cloudfront https://thumbnails.openveda.cloud/. Update production collection metadata to include these thumbnails as assets to improve the browser experience.

Parent issues

#124 #122

Notes

For a first pass at improving our browser experience we can use exactly the same thumbnails that are configured in the dashboard for our STAC collections. The thumbnails from veda-config/datasets have already been copied to the thumbnail bucket but the thumbnails in eic-config have not (there is a large amount of overlap, probably only the climdex-* thumbnails need to be copied to the thumbnail bucket.

For a collection in s3, you can identify the dataset name by searching the collection id in veda-config and using the data.mdx file to identify the appropriate thumbnail. Veda-config groups datasets so in this first pass some of our collections will have duplicate thumbnails.

Config mdx example

For the hls-events.ej.data.mdx configuration, the thumbnail hls-events-ej--dataset-cover.png is located in media attributes.

---
id: hls_events
name: 'Harmonized Landsat Sentinel-2 (Selected Events)'
description: '30-meter resolution harmonized Landsat 8/9 and Sentinel-2A/B data products'
usage:
  - url: "https://nasa-impact.github.io/veda-docs/notebooks/quickstarts/hls-visualization.html"
    label: View example notebook
    title: 'Multi-Band Visualization Preview for Harmonized Landsat Sentinel-2 (HLS)'
  - url: "https://nasa-veda.2i2c.cloud/hub/user-redirect/git-pull?repo=https://github.com/NASA-IMPACT/veda-docs&urlpath=lab/tree/veda-docs/notebooks/quickstarts/hls-visualization.ipynb&branch=main"
    label: Run example notebook
    title: 'Multi-Band Visualization Preview for Harmonized Landsat Sentinel-2 (HLS)'
media:
  src: ::file ./hls-events-ej--dataset-cover.png
  alt: 2017 harmonized Landsat 8 shortwave infrared (SWIR) false color composite image that provides enhanced contrast to detect flood extent.
  <SNIP>
layers:
  - id: hls-l30-002-ej
    stacCol: hls-l30-002-ej-reprocessed
    name: HLS Landsat SWIR
<SNIP>

STAC Collection metadata example

Thumbnail objects are added to the assets property of a collection with the key thumbnail. If a collection does not already have an assets. See https://test.openveda.cloud/api/stac/collections/hls-l30-002-ej-reprocessed for an example of a collection with a thumbnail asset.

"assets": {
    "thumbnail": {
        "title": "Thumbnail",
        "href": "https://thumbnails.openveda.cloud/<dataset-name>.png",
        "type": "image/png",
        "roles": ["thumbnail"]
    },
   "someotherasset": {
        "title": "Name of an asset",
        "href": "somewhere.com",
        "roles": ["datal"]
    }
}

veda-configs

AC

  • thumbnails from veda-config datasets uploaded to s3://veda-thumbnails
  • eic-only thumbnails from eic config uploaded to s3://veda-thumbnails
  • BONUS landsat-c2l2-sr-* thumbnails identified
  • Landsat thumbnails resized (if needed) and uploaded to s3://veda-thumbnails
  • production collection metadata updated to include thumbnail assets in veda-data and published to production catalog
@anayeaye
Copy link
Contributor Author

anayeaye commented Jun 7, 2024

@j08lue I think the fastest way for us to add thumbnails to our catalog is to just use the mdx thumbnails which means we will have many duplicated tiles in our browser. It also means we don't have anything as a placeholder for the landsat lakes/glaciers collections but IIRC we had thumbnails for those at one point. Do you recall where those are (maybe git history?) and do you think the duplicates will be OK?

@j08lue
Copy link
Contributor

j08lue commented Jun 10, 2024

Thumbnails from the Dashboard config are fine, @anayeaye.

I do not think we had thumbnails for the Landsat collections, so I created some. Sizes / aspect ratios are unfortunately not consistent.

Please crop and/or resample them, if need be. No worries if parts of the lakes or so get cut off.

landsat-c2l2-sr-antarctic-glaciers-thwaites

Screenshot from EO Dashboard

landsat-c2l2-sr-antarctic-glaciers-thwaites

landsat-c2l2-sr-antarctic-glaciers-pine-island

Screenshot from EO Dashboard

landsat-c2l2-sr-antarctic-glaciers-pine-island

landsat-c2l2-sr-lakes-vanern

Screenshot from EO Dashboard

landsat-c2l2-sr-lakes-vanern

landsat-c2l2-sr-lakes-lake-balaton

Screenshot from EO Dashboard

landsat-c2l2-sr-lakes-lake-balaton

landsat-c2l2-sr-lakes-aral-sea

Screenshot from Planetary Computer

landsat-c2l2-sr-lakes-aral-sea

landsat-c2l2-sr-lakes-tonle-sap

Screenshot from Planetary Computer

landsat-c2l2-sr-lakes-tonle-sap

landsat-c2l2-sr-lakes-lake-biwa

Screenshot from Planetary Computer

landsat-c2l2-sr-lakes-lake-biwa

PNG thumbnails named by collection, zipped

landsat-collection-thumbnails.zip

@j08lue
Copy link
Contributor

j08lue commented Jun 10, 2024

Should we generally name the thumbnails after the collection ID?

@anayeaye anayeaye self-assigned this Jun 11, 2024
@anayeaye
Copy link
Contributor Author

anayeaye commented Jun 11, 2024

stac-spec + thumbnail attribution

We haven't yet planned how to handle attribution for the thumbnails we are using. Veda-config handles attribution in the dataset mdx file (example).
veda config

media:
  src: ::file ./caldor-fire--dataset-cover.jpg
  alt: Hillside engulfed by a wildfire.
  author:
    name: Marek Piwnicki
    url: https://unsplash.com/photos/WiZOyYqzUss

stac catalog
In the stac-spec we have the provider object, but that feels odd to include the thumbnail producer alongside the data producers. Inside the asset object we have the description property where we could add author and the source url for the thumbnail.
For reference we are adding assets to our collection metadata like this to make for a nicer stac-browser experience:

...,
    "assets": {
        "thumbnail": {
            "title": "Thumbnail",
            "description": "<???MAYBE thumb author here?>",
            "href": "https://thumbnails.openveda.cloud/caldor-fire--dataset-cover.jpg",
            "type": "image/jpeg",
            "roles": ["thumbnail"]
        }
    }

@anayeaye
Copy link
Contributor Author

I've added thumbnails to all the production collection metadata in PR #145 and published to https://test.openveda.cloud/ 🚀

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

No branches or pull requests

2 participants