Skip to main content

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

RoutePurpose
POST /terrain/{dataset_id}/generategenerate terrain tiles
GET /terrain/{dataset_id}/tilejson.jsonretrieve TileJSON
GET /terrain/{dataset_id}/tiles/{z}/{x}/{y}.pngserve XYZ terrain tiles
GET /terrain/{dataset_id}/mbtiles/{z}/{x}/{y}.pngserve MBTiles terrain tiles
POST /terrain/{dataset_id}/unpack-mbtilesconvert MBTiles output to directory tiles
POST /terrain/mergemerge multiple datasets before terrain generation

Mago Terrain

Cesium-focused terrain generation is handled by the Mago terrainer workflow.

Relevant routes:

  • POST /terrain/mago
  • GET /terrain/mago

Relevant runtime pieces:

  • mago-terrainer helper container
  • mago-terrain nginx 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