Terrain and Elevation Workflows
Terrain RGB Generation
Terrain RGB tiles are generated from raster datasets through terrain routes and persisted under /data/terrain.
Key outputs:
- TileJSON metadata
- XYZ tile directories
- optional MBTiles based distribution and unpack workflows
Main Terrain Routes
| Route | Purpose |
|---|---|
POST /terrain/{dataset_id}/generate | generate terrain tiles |
GET /terrain/{dataset_id}/tilejson.json | retrieve TileJSON |
GET /terrain/{dataset_id}/tiles/{z}/{x}/{y}.png | serve XYZ terrain tiles |
GET /terrain/{dataset_id}/mbtiles/{z}/{x}/{y}.png | serve MBTiles terrain tiles |
POST /terrain/{dataset_id}/unpack-mbtiles | convert MBTiles output to directory tiles |
POST /terrain/merge | merge multiple datasets before terrain generation |
Mago Terrain
Cesium-focused terrain generation is handled by the Mago terrainer workflow.
Relevant routes:
POST /terrain/magoGET /terrain/mago
Relevant runtime pieces:
mago-terrainerhelper containermago-terrainnginx service that publishes generated terrain assets- public URL configuration through
MAGO_TERRAIN_PUBLIC_URL
Viewer Integration
Terrain outputs are consumed by:
- the MapLibre viewer
- the Cesium terrain test templates
- external clients that consume TileJSON or direct tiles
Operational Advice
- large terrain generations are async and should be monitored through
/jobs - merged terrain jobs can be I/O heavy and should be treated as worker-intensive operations
- when running in the local swarm profile, pay attention to worker recycling and memory limits during large conversions