Skip to content

feat: support tilingMode: cog for raster data type to allow visualization from external stac#1982

Merged
slesaad merged 11 commits into
mainfrom
feat/support-external-stac
Jun 3, 2026
Merged

feat: support tilingMode: cog for raster data type to allow visualization from external stac#1982
slesaad merged 11 commits into
mainfrom
feat/support-external-stac

Conversation

@slesaad

@slesaad slesaad commented Apr 15, 2026

Copy link
Copy Markdown
Member

Support external STAC servers via tilingMode: cog

Summary

Adds a new tilingMode option to raster datasets so they can be tiled
either via VEDA's mosaic register endpoint (the existing default) or via
titiler's per-item /cog/tiles endpoint. The latter unlocks consumption of
external STAC servers (Element84 Earth Search, GHG Center, NASA CMR
CloudSTAC, etc.) that don't expose a mosaic register endpoint.

Dataset config

type: raster
tilingMode: cog              # 'mosaic' (default) | 'cog'
stacApiEndpoint: https://earth-search.aws.element84.com/v1
tileApiEndpoint: https://openveda.cloud/api/raster
stacCol: sentinel-2-l2a
searchLimit: 100             # caps items per /search request
sourceParams:
  assets: red
  colormap_name: viridis
  rescale: [0, 10000]
  • tilingMode: 'mosaic' (default): unchanged behavior.
    /searches/register produces one tilejson for the whole CQL filter.
  • tilingMode: 'cog': per-item COG tiling. For each STAC item, the
    selected asset's href (preferring alternate.s3.href when present)
    is passed to /cog/tiles?url=.... Multiple items render as separate
    layers stacked on the map.

What's also new

  • searchLimit: configurable per-dataset cap on items per /search.
    Some external servers (e.g. Element84) error out with limit: 1000.
    Works in both tiling modes.
  • Pagination: STAC search responses with a next link now power a
    "Showing N of M items — Load More" overlay. Handles both GET and
    POST next-link methods.
  • FootprintsLayer: replaces the marker-based PointsLayer for both
    raster modes. Renders STAC item geometry when the response includes it
    (cog mode), bbox polygons otherwise (mosaic mode). Respects parent
    layer's hidden / opacity / generatorOrder.

File-level changes

File Change
types/veda.ts, parcel-resolver-veda/index.d.ts Add tilingMode, searchLimit to DatasetLayer; remove unused external-stac from DatasetLayerType.
style-generators/raster-cog-timeseries.tsx (new) Per-item COG tiling component.
style-generators/raster-timeseries.tsx Adds searchLimit + pagination. Mosaic register guarded against re-registration on pagination.
style-generators/footprints-layer.tsx (new) Polygon footprints layer used by both raster modes.
style-generators/pagination-overlay.tsx (new) Shared "Load More" UI.
exploration/components/map/layer.tsx case 'raster' branches on tilingMode === 'cog'.
exploration/hooks/use-stac-metadata-datasets.ts New branch for type === 'raster' && tilingMode === 'cog' to handle external STAC metadata structures.
mock/datasets/*-external.data.mdx, *-element84.data.mdx Test datasets exercising the new path against Element84, GHG Center, and CMR CloudSTAC.

Backwards compatibility

tilingMode defaults to 'mosaic'. All existing raster datasets
continue to work without any config change.

Test plan

  • Existing internal raster dataset still renders identically (no new
    searchLimit/tilingMode in MDX).
  • Sentinel-2 / Landsat (Element84) renders cog tiles; "Load More"
    reveals additional footprints without yanking the map.
  • HLS L30 (NASA CMR CloudSTAC) renders cog tiles.
  • Hide / show / change opacity / change order on a cog layer
    toggles its footprints alongside its tiles.
  • Removing a cog dataset from the timeline cleans up its sources
    and layers from the map style.
  • Date change while a loadMore is in flight aborts cleanly (no
    console warnings about state-after-unmount).

@netlify

netlify Bot commented Apr 15, 2026

Copy link
Copy Markdown

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 47163b0
🔍 Latest deploy log https://app.netlify.com/projects/veda-ui/deploys/6a1ef24da4c5c7000860af14
😎 Deploy Preview https://deploy-preview-1982--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@slesaad slesaad marked this pull request as draft April 21, 2026 00:00
@slesaad slesaad changed the title feat: support external stac feat: support tilingMode: cog for raster data type to allow visualization from external stac Apr 29, 2026
@slesaad slesaad marked this pull request as ready for review May 6, 2026 15:41
@slesaad slesaad requested a review from dzole0311 May 6, 2026 15:41
assetHref: string;
}

interface StacLink {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like we could reuse StacLink, PaginationState and the loadMore callback between the two timeseries files

@slesaad slesaad requested a review from dzole0311 June 2, 2026 15:10

@dzole0311 dzole0311 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@slesaad I did a smoke test using the mocked datasets from this PR and it works well. Approving this since it sounds like you’d like to get it merged for the GHG instance.

I'm adding a few notes below for documentation purposes especially if the same datasets are used downstream in other instances:

  1. In the downstream app, we should disable colormap and analysis controls for the new vector layers (if the same layers are used there like the mocked ones here)
  2. Clicking and zooming to the vector layer makes it invisible. This might be related to min/max zoom settings
rec.mp4
  1. I don’t see the Mangrove AGB dataset mentioned in the test instructions available to test with. I only see/tested:
    • HLS Landsat via NASA CMR STAC
    • Landsat C2 L2 via Element84
    • Sentinel-2 via Element84

@slesaad

slesaad commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

thanks @dzole0311 !

regarding your concerns:

  1. yes, depending on the dataset, that makes sense!
  2. the vector data is showing the footprint of the raster data that exist in these regions and when you click/zoom to the area, the vector layer disappears and the raster layer appears (they probably were slow to appear)
  3. that's my bad, i didn't push mangrove dataset 😅 , i'll update the description

@slesaad slesaad merged commit f9371b6 into main Jun 3, 2026
10 of 11 checks passed
@slesaad slesaad deleted the feat/support-external-stac branch June 3, 2026 14:45
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.

2 participants