feat: map viewer at /maps with STAC-backed display metadata#76
Draft
feat: map viewer at /maps with STAC-backed display metadata#76
Conversation
Add a display block to each built-in dataset template (colormap, value range, nodata) and surface it through the STAC Render extension on every published collection. Add a /maps endpoint that serves a single-page map viewer: it reads the STAC catalog to list available datasets, loads the Render and Datacube metadata to configure a ZarrLayer (MapLibre + @carbonplan/zarr-layer), and builds a time slider from cube:dimensions. No tile server or build step required — the browser reads the Zarr store directly via the existing /zarr HTTP range endpoint. Closes #66
Implements issue #72. Adds a server-rendered management page at GET /manage that lets operators ingest and sync datasets without needing to know API endpoint details or dataset template IDs. - GET /manage renders a Jinja2 page with an ingest form (template dropdown, start/end dates, extent pre-filled) and a status table with per-dataset Sync buttons; flash messages show success or error after each operation - POST /manage/ingest handles the ingest form and redirects back to /manage - POST /manage/sync handles the sync form and redirects back to /manage - Landing page gains an "Available dataset templates" card listing all registered templates and a Manage link in the Explore section
Pass opacity: 0.75 to ZarrLayer so the basemap shows through the data layer. Also wire renders.nodata from the STAC collection into ZarrLayer's fillValue so dataset-specific nodata pixels render as transparent.
Shows a gradient bar with min/max labels and units when a dataset is selected. Legend is built from the same colormap and clim range used by the data layer, sourced from the STAC renders block.
Replaces the OSM raster style with OpenFreeMap's positron vector style. The data layer is inserted before the first symbol layer so country borders, road labels, and place names always render on top of the climate data.
Replaces the OSM raster style with OpenFreeMap's positron vector style. The data layer is inserted before the first symbol layer so country borders, road labels, and place names always render on top of the climate data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
displayblock (colormap, range, nodata) to each built-in dataset template YAMLclimate_api:variableandclimate_api:unitsvendor fieldsGET /maps— a single-page HTML map viewer that reads the STAC catalog, loads per-dataset render and datacube metadata, and renders data via MapLibre GL +@carbonplan/zarr-layerwith a time slider derived fromcube:dimensionsHow it works
The browser reads the Zarr store directly via the existing
/zarr/{dataset_id}HTTP range endpoint. No tile server, no build step.Display defaults
Test plan
http://localhost:8000/maps/stac/catalog.json/stac/collections/{id}includesrendersand the Render extension URL instac_extensionsdisplayblock produces norendersin the collectionCloses #66