Loka Server

3D

3D cities and terrain

Turn a polygon layer with heights or storeys into an OGC 3D Tiles city on the server, or host a finished tileset, and serve terrain to Cesium and other 3D clients.

A city from footprints

Point Loka Server at a polygon layer and the field that holds a height or the number of storeys. It extrudes every footprint, sets it on your terrain and writes an OGC 3D Tiles tileset; central Jakarta takes about a second.

Each building keeps its id, name and height, so clients can pick and colour them. A finished tileset from another tool can be uploaded and hosted as it is.

Elevation layers serve the ground beneath: Terrain-RGB and quantized-mesh for 3D engines, hillshade and heights over WMS, raw heights over WCS.

City and terrain

Buildings, elevation and how they meet

The same Jakarta buildings and the Copernicus elevation around Bogor, from the data to the 3D view.

From footprints to a city

What goes in, and what comes out?

The colours are a style in the client, not baked into the tiles: each building carries its height, so CesiumJS colours it with a 3D Tiles style and casts shadows from the sun at the chosen time.

Flat green building footprints of central Jakarta
The input: footprintsA polygon layer with height and storey tags, served as WMS like any other.
Top-down 3D view of the same Jakarta buildings, light grey with long shadows
The output: 3D TilesEvery footprint extruded to its height, light by height, with afternoon shadows.

In this example

Style
{"color": {"conditions": [["${height} >= 150", "color('#B4C4D2')"], …]}}
Shadows
CesiumJS sun at 15:30 local time

Terrain from DTED or GeoTIFF

What does the server make of an elevation file?

Import DTED level 0, 1 or 2 cells, or an elevation GeoTIFF that is converted for you; one elevation layer holds many cells. From it the server serves shaded relief and coloured heights over WMS, raw heights over WCS, Terrain-RGB tiles in the Terrarium encoding and quantized-mesh for CesiumJS, and every terrain analysis on the analysis page.

The green and magenta bands in the third picture are not a style: they are the heights encoded as colours (height = R × 256 + G + B ÷ 256 − 32768 m), the green channel wrapping every 256 m.

Grey shaded relief of Gunung Salak and Bogor
HillshadeShaded relief over WMS: Gunung Salak and the valleys to Bogor.
Heights in colour from green to brown over shaded relief
Heights in colourColoured heights over the same relief, green lowland to brown summit.
Raw Terrain-RGB tiles of the same area in green and magenta bands
Terrain-RGB tilesWhat a 3D client downloads: heights packed in red, green and blue (Terrarium).

In this example

Demo
Copernicus GLO-30, tile S07 E106 (30 m)
Tiles
…/terrarium/{z}/{x}/{y}.png, zoom 1 to 13
3D
…/quantized-mesh/layer.json
3D view from Bogor towards Gunung Salak, shaded and coloured terrain under a blue sky

The terrain in 3D

How does it look in a 3D client?

CesiumJS reads the quantized-mesh terrain and drapes the same hillshade and heights over it as WMS imagery. Any layer of the server can be draped the same way: a chart, a forecast, a viewshed.

Try it on your own data: in the console, Elevation → Open in CesiumJS opens the workspace with its terrain, 3D tilesets and layers to switch on, and a line-of-sight tool.

In this example

Terrain
quantized-mesh from the elevation layer
Imagery
hillshade and heights, WMS
Heights
exaggerated 1.5 times
3D city of Jakarta with a line of sight from a roof, green up to a tower and dashed red behind it to the target

Buildings on the terrain, with analyses

Do the buildings sit on the ground, and do analyses see them?

Built with an elevation layer, every building stands on the terrain at its footprint, so it lines up with terrain in any client. The same buildings stand in the analyses: here the rooftop line of sight from the analysis page, cut by a tower 1.1 km out.

In this example

Build option
elevationLayerId
Line of sight
40 m roof to a point 20 m up, 3.2 km away

Capabilities

What it does

Build from footprints

Height or storeys per polygon, set on the terrain.

Attributes kept

Id, name and height per building, for picking and styling.

Host a tileset

Upload a finished OGC 3D Tiles tileset and serve it.

Terrain

Terrain-RGB and quantized-mesh from DTED or an elevation GeoTIFF.

Vector tiles

Polygons with a height become extrusions in MapLibre.

Preview

Check it in loka.gl in the console, on real terrain.

Input and output

Inputs and what they become

3D data is published like any other layer.

InputOutput
Polygons + height or storeysOGC 3D Tiles city
A 3D Tiles tileset (ZIP)Hosted tileset
DTED, elevation GeoTIFFTerrain-RGB, quantized-mesh, hillshade, heights

How to

Three steps to a 3D city

  1. Choose a layerA polygon layer with a height or storeys field.
  2. BuildStart the 3D build; the tileset is written on the server.
  3. ServeCopy the tileset address into CesiumJS, deck.gl or loka.gl.

Good to know

Notes and limits

Buildings are extruded footprints with flat roofs, one height per footprint.

The demo city uses OpenStreetMap heights and storeys as tagged; untagged buildings are as good as their tags.