Skip to content

Cesium: keyless Terrarium terrain provider and COG-backed terrain #2286

Description

@giswqs

Part of #2259. Cesium parity roadmap, tier 3.

Problem

CesiumCanvas only enables terrain when a Cesium Ion token is present (terrainEnabled && Boolean(ionToken)), because setTerrainEnabled calls createWorldTerrainAsync. getTerrainCogSource returns null, hasCustomTerrainSource is false, and setTerrainCogSource resolves false. So the Controls → Terrain toggle and the Terrain Settings dialog do nothing on a keyless globe, while the 2D map has keyless AWS Terrarium terrain plus COG-backed terrain.

Proposal

  • Write a TerrariumTerrainProvider implementing Cesium's TerrainProvider: fetch the AWS Terrain Tiles PNG, decode RGB → metres, downsample to a HeightmapTerrainData grid (65×65 or 33×33), with a WebMercatorTilingScheme and availability derived from the source's max zoom. Cesium consumes heightmap terrain natively, so no quantized-mesh work is required.
  • Point the same provider at the existing COG → Terrarium tile producer in cog-dem-source.ts to implement setTerrainCogSource, making the Terrain Settings dialog engine-neutral.
  • Keep Cesium World Terrain as the upgrade when a token exists; drop the token gate in CesiumCanvas.
  • Mount TerrainSettingsDialog on the globe (it is in the MapLibre-only subtree in DesktopShell).

Effort

Medium.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement (medium)Broader feature, feasible within a reasonable timeframe

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions