viz.raster_map

Draw a raster as a map: one band with a colour map, or three bands as RGB, optionally over a hillshade. Reads at the drawn size, from overviews when present.

  • Kind: standard
  • Network: no
  • Memory: 8Gi

Inputs🔗

NameTypeRequiredDefaultDescription
rasterfile (GeoTIFF)yesRaster to draw.
hillshadefile (GeoTIFF)noShaded relief drawn beneath the raster.
stylefile (JSON)noA JSON document whose fields override the arguments below.
bandnumberno1Band to draw.
rgb_bandsstringnoblankThree bands to draw as RGB, e.g. "4,3,2". Overrides band.
colormapstringnoviridismatplotlib colour map name.
stretchstringnominmaxHow values map to colours. One of minmax, percent_clip, stddev.
nodata_colorstringnoblankColour behind nodata pixels; blank leaves them white.
legendbooleannoTrueDraw a colour bar.
max_pixelsnumberno4096Longest edge, in pixels, the raster is read at.
titlestringnoblankChart title. ${item.key} labels each chart inside a map.
widthnumberno8Figure width in inches.
formatstringnopngImage format. html is a static, self-contained page. One of png, svg, html.

Outputs🔗

NameTypeDescription
mapfile (PNG)The map.

Example🔗

- id: "@raster_map"
  name: viz.raster_map
  inputs: [{block: "@dem", output: raster, as: raster}]
  args:
    colormap: terrain
    stretch: percent_clip
    title: Elevation