For the complete documentation index, see llms.txt. This page is also available as Markdown.

Raster visualizations

Raster layers are styled with one of five type values. They share a common set of config options and never support popups or labels.

Mode

type

Use it for

simple

Display the raster as-is (satellite, aerial, base tiles)

numeric

Classify one band (elevation, temperature, a hazard index)

numeric

Compute a spectral index (NDVI, NDMI, NDWI) from several bands

categorical

Discrete pixel classes (land cover, soil types)

hillshade

Relief shading from elevation, optionally tinted

Shared config options

Option
Notes

band

Which band to read (1-indexed). Numeric/hillshade.

steps

Classification — see Classification methods. {"type": "continuous"} for smooth, or breaks like [0, 500, 1000].

method

Spectral-index formula and band mapping (multiband only).

categories

Categorical only — {"type": "all"} for every pixel value, or an explicit array.

noData

Value(s) to exclude, e.g. [-9999] for voids or [0] for no-data.

rasterResampling

Numeric and tinted hillshade only — categorical rasters reject it (they always resample nearest). "nearest" keeps exact pixel values; "linear" interpolates (use for continuous imagery/elevation).

outOfRangeValues

"color" clamps to the nearest class color; "hide" makes them transparent.

In paint, color takes a raster palette or an explicit color array, plus opacity and isSandwiched (render below basemap water/roads).

Image (simple)

Renders the image with no classification — just opacity and resampling.

Numeric — single band

Classify one band. Prefer continuous for smooth data (elevation, temperature); use breaks for discrete groups (hazard levels).

Classed with explicit colors works the same way — band replaces numericAttribute, and the color array has one entry per class:

Numeric — multiband (raster algebra)

Compute a derived index from multiple bands before classifying. The config.method names the index and maps its inputs to band numbers, and band lists every band used. Supported indices:

  • NDVI(NIR − R) / (NIR + R), vegetation health. Requires NIR, R.

  • NDMI(NIR − SWIR) / (NIR + SWIR), moisture. Requires NIR, SWIR.

  • NDWI(G − NIR) / (G + NIR), water. Requires G, NIR.

Band numbers are 1-indexed and sensor-specific (Landsat 8/9: R=4, G=3, NIR=5, SWIR=6 · Sentinel-2: R=4, G=3, NIR=8, SWIR=11).

NDVI output ranges from −1 (water/bare) to 1 (dense vegetation); classify it with explicit breaks (e.g. [-1, -0.2, 0, 0.2, 0.4, 0.6, 1]) for labelled classes. Good starting points: NDVI → [-0.5, 0.5] with @cbRedYlGrn; NDWI → [-0.5, 0.25] and NDMI → [-0.5, 0.5] with @feltVibrant.

Categorical

Raster categories are raw pixel values (integers), so there is no categoricalAttribute. Use {"type": "all"} when you don't know the values, or an explicit array when you do, with one color per value. Don't set rasterResampling here — categorical rasters always use nearest resampling automatically (the property is rejected on this type), since linear interpolation would blend category codes into invalid values.

For raster categorical, use the vector categorical palettes (@catPalette1@catPalette7). A fully-transparent class can be expressed as "rgba(0, 0, 0, 0)".

Hillshade

Simulates light and shadow on terrain. Plain hillshade is grayscale relief (config carries just band; paint carries source and intensity). Tinted hillshade overlays a hypsometric color ramp — add steps to config and color to paint; only do this when elevation coloring is wanted.

Paint property
Default
Notes

source

315

Light azimuth in degrees (0 = North, 90 = East). 315 (northwest) is standard.

intensity

0.5

Shadow intensity 0–1; higher = more dramatic relief.

color

Raster palette or color array (tinted only), low → high elevation.

Tinted, classifying elevation like any numeric raster (use rasterResampling: "linear" and noData for voids):

Last updated

Was this helpful?