You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The backend API is documented at https://developmentseed.org/titiler-cmr. Key endpoints used by this app:
43
43
44
-
-**TileJSON:**`GET /{backend}/tilejson.json` — returns metadata including tile URL template; pass as a `raster-source` in MapLibre
44
+
-**TileJSON:**`GET /{backend}/WebMercatorQuad/tilejson.json` — returns metadata including tile URL template; pass as a `raster-source` in MapLibre
45
45
-**Tiles:**`GET /{backend}/tiles/{z}/{x}/{y}` — the actual tile imagery (`rasterio` backend for GeoTIFF/COG, `xarray` for NetCDF/HDF5)
46
-
-**Granule search:**`GET /bbox/{minx},{miny},{maxx},{maxy}/granules` — find available granules in a bounding box
47
46
48
-
Common query parameters for tile requests: `concept_id`, `datetime`, `assets`/`bands`, `rescale`, `colormap_name`.
47
+
Common query parameters for tile requests: `collection_concept_id`, `datetime`, `assets`/`variables`, `assets_regex`, `rescale`, `colormap_name`, `expression`, `minzoom`, `maxzoom`.
49
48
50
-
The hosted titiler-cmr instance URL should be stored in a single config constant (e.g., `src/config.ts`) so it can be easily swapped between environments.
49
+
The hosted titiler-cmr instance URL is stored in `src/config.ts` as `TITILER_ENDPOINT` (currently `https://staging.openveda.cloud/api/titiler-cmr`).
51
50
52
51
## Architecture
53
52
54
-
Single-page static site, no server-side code. Globe projection via MapLibre GL JS v5 (`map.setProjection({ type: 'globe' })` called on `load`).
53
+
Single-page static site, no server-side code. Globe projection via MapLibre GL JS v5 (`map.setProjection({ type: 'globe' })` called on `load`). Base map style: CartoCDN dark-matter.
54
+
55
+
MapLibre parallel image request limits are bumped to 64 (`MAX_PARALLEL_IMAGE_REQUESTS` and `MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME`) because CMR tiles are slow and benefit from aggressive parallel fetching.
Add a new `DatasetConfig` entry to the `DATASETS` array in `src/config.ts`. No other code changes are needed. Each collection needs: `conceptId`, `assetsRegex`, `backend` (`rasterio` | `xarray`), `minzoom`/`maxzoom`, `defaultDate`, and a `renders` array of `RenderConfig` objects.
70
-
71
-
### Layer update flow
72
-
73
-
Controls emit a `ControlState` on any change → `updateLayer()` removes the previous `cmr-layer`/`cmr-source` and adds a new raster source pointing at the TileJSON endpoint with all render params encoded in the URL. MapLibre fetches TileJSON natively when `type: 'raster'` with a `url` field is used.
68
+
## Type System (`src/config.ts`)
69
+
70
+
### `DatasetConfig`
71
+
Top-level entry in `DATASETS`. Has `id`, `label`, and `collection` (a single `CollectionConfig` hides the collection selector; an array shows it).
72
+
73
+
### `CollectionConfig`
74
+
Describes one CMR collection. Key fields:
75
+
-`collectionConceptId` — CMR concept ID passed as `collection_concept_id`
76
+
-`backend` — `"rasterio"` (GeoTIFF/COG) or `"xarray"` (NetCDF/HDF5)
77
+
-`assetsRegex` — optional regex forwarded to titiler-cmr for asset filtering
78
+
-`minzoom` / `maxzoom`
79
+
-`attribution` — HTML string shown in MapLibre attribution control
80
+
-`date: DateConfig` — controls date picker UI and `datetime` param format
81
+
-`renders: RenderConfig[]`
82
+
-`queryParams?: QueryParamConfig[]` — optional extra controls surfaced in the "Advanced" panel
83
+
84
+
### `DateConfig`
85
+
Controls how the date UI is rendered and how `datetime` is serialized:
86
+
-`{ mode: "single"; default: string }` — one date input; datetime sent as a single-day range
87
+
-`{ mode: "range"; default: [string, string] }` — two date inputs (start / end)
88
+
-`{ mode: "month"; default: string }` — month/year picker; datetime sent as full calendar month range
89
+
90
+
### `RenderConfig`
91
+
One entry in `collection.renders`. Has `label`, optional `assets[]` (rasterio) or `variables[]` (xarray), `params` (arbitrary extra query params, values may be arrays for repeated params), and optional `subLayers`.
92
+
93
+
### `SubLayerSpec`
94
+
When `render.subLayers` is set, `updateLayer()` creates one map layer per entry instead of a single layer. Each sub-layer has its own `params` override (e.g. `group` for xarray) and `minzoom`/`maxzoom`. Used for NISAR frequencyA/B switching based on zoom level.
95
+
96
+
### `QueryParamConfig`
97
+
Union of four control types surfaced in the "Advanced" collapsible:
98
+
-`RangeQueryParam` — two number inputs rendered as `"min,max"`
99
+
-`SelectQueryParam` — dropdown; value sent as-is
100
+
-`TextQueryParam` — free-text input
101
+
-`AttributeQueryParam` — CMR additional-attribute filter; serialized as `attributeType,attributeName,value` under the `attribute` key. Supports a null value to omit the filter.
102
+
103
+
## Layer Update Flow
104
+
105
+
Controls emit a `ControlState` on any change → `updateLayer()`:
106
+
1. Scans and removes all `cmr-0`…`cmr-7` layers/sources (fixed ID space, tolerates partial failures)
<p>An interactive map showcasing <ahref="https://developmentseed.org/titiler-cmr" target="_blank" rel="noopener">titiler-cmr</a>'s ability to render NASA Earthdata assets on-the-fly. Browse datasets, adjust date ranges, and explore rendering options — all served as map tiles from a live titiler-cmr instance.</p>
42
+
</section>
43
+
<section>
44
+
<h3>NASA CMR</h3>
45
+
<p>The <ahref="https://cmr.earthdata.nasa.gov" target="_blank" rel="noopener">Common Metadata Repository</a> is NASA's catalog for Earth science data. It indexes thousands of collections — satellite imagery, atmospheric data, ocean observations — and exposes a unified search API used to locate assets for rendering.</p>
46
+
</section>
47
+
<section>
48
+
<h3>titiler-cmr</h3>
49
+
<p><ahref="https://developmentseed.org/titiler-cmr" target="_blank" rel="noopener">titiler-cmr</a> is a dynamic tile server built on <ahref="https://developmentseed.org/titiler" target="_blank" rel="noopener">TiTiler</a> that reads Cloud-Optimized GeoTIFFs and NetCDF/HDF5 assets directly from CMR, reprojects them, and serves map tiles without any preprocessing or data duplication.</p>
0 commit comments