Skip to content

Terrain Providers

Configure terrain for the globe.

terrain

Terrain provider types for CesiumJS elevation data sources.

TerrainProvider

Bases: CesiumBase

Base for all terrain providers.

EllipsoidTerrainProvider

Bases: TerrainProvider

A terrain provider that provides no elevation (smooth ellipsoid).

CesiumTerrainProvider

Bases: TerrainProvider

Provides terrain data from a Cesium terrain server.

IonTerrainProvider

Bases: TerrainProvider

Provides terrain from Cesium Ion (default: Cesium World Terrain).

WmsTerrainProvider

Bases: _ImageHeightmapTerrainProvider

Adapt encoded WMS elevation images into Cesium heightmap terrain.

The WMS layer must render elevations as Terrain-RGB, Terrarium, or grayscale pixels and permit browser CORS requests.

WmtsTerrainProvider

Bases: _ImageHeightmapTerrainProvider

Adapt encoded WMTS elevation tiles into Cesium heightmap terrain.

WMS and WMTS elevation images

CesiumJS has no native WMS/WMTS terrain provider. Cesiumkit adapts encoded elevation images through Cesium.CustomHeightmapTerrainProvider:

terrain = cesiumkit.WmsTerrainProvider(
    url="https://terrain.example.com/wms",
    layers="elevation_rgb",
    encoding="terrain-rgb",  # terrain-rgb, terrarium, or grayscale
    maximum_level=14,
)
viewer = cesiumkit.Viewer(terrain_provider=terrain)

For WMTS, provide the KVP endpoint, layer, and tile matrix set with WmtsTerrainProvider.

The source layer must return PNG/WebP tiles whose pixels encode elevation in the selected format. Browser access also requires CORS permission from the terrain server. height_scale and height_offset can adjust decoded values, especially for grayscale layers.