Skip to content

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

Open
slesaad wants to merge 10 commits into
mainfrom
feat/support-external-stac
Open

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

Conversation

@slesaad
Copy link
Copy Markdown
Member

@slesaad slesaad commented Apr 15, 2026

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).
  • Mangrove AGB (GHG Center) renders cog tiles when a date with items
    is selected.
  • 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
Copy link
Copy Markdown

netlify Bot commented Apr 15, 2026

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit e36c703
🔍 Latest deploy log https://app.netlify.com/projects/veda-ui/deploys/69f16cfc6d0f34000896d95e
😎 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
import { S_FAILED, S_LOADING, S_SUCCEEDED } from '$utils/status';

// Whether or not to print the request logs.
const LOG = process.env.NODE_ENV !== 'production' ? true : false;
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.

Suggested change
const LOG = process.env.NODE_ENV !== 'production' ? true : false;
const LOG = process.env.NODE_ENV !== 'production';

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

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