Plot DEM
Category: Mega-Polis → Visualisation → Visualisation Design Tools
Node ID:SvMegapolisPlotDem
Tooltip: Plot a Dem Array
Dependencies:richdem(usesrd.rdShow) :contentReferenceoaicite:0
Functionality
Plots a DEM (2D raster/array) using RichDEM’s rd.rdShow(...).
When run is enabled, the node visualises the input Dem Array with:
- optional axes on/off
- configurable figure size (width/height)
- selectable sequential colormap
ignore_colours=[0](treats value 0 as a special colour to ignore) :contentReferenceoaicite:1
Inputs
| Socket | Type | Description |
|---|---|---|
| Dem Array | SvStringsSocket | 2D DEM array to plot. Must be linked. :contentReferenceoaicite:2 |
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| run | Bool | False | If True, triggers rd.rdShow(...) to display the plot. :contentReferenceoaicite:3 |
| axes | Bool | False | Show/hide plot axes. :contentReferenceoaicite:4 |
| width | Int | 8 | Plot width used in figsize=(width, height). :contentReferenceoaicite:5 |
| height | Int | 5 | Plot height used in figsize=(width, height). :contentReferenceoaicite:6 |
| colour | Enum | inferno | Sequential colormap passed as cmap=self.colour. :contentReferenceoaicite:7 |
Available colormaps (enum)
Includes (as defined in the node):
viridis, plasma, inferno, magma, cividis, Greys, Purples, Blues, Greens, Oranges, Reds, YlOrBr, YlOrRd, OrRd, PuRd, RdPu, BuPu, GnBu, PuBu, YlGnBu, PuBuGn, BuGn, YlGn, binary, gist_yarg, gist_gray, gray, bone, pink, spring, summer, autumn, winter, cool, Wistia, hot, afmhot, gist_heat, copper. :contentReferenceoaicite:8
Outputs
This node has no output sockets. It is a visualisation-only node that displays a plot when run=True. :contentReferenceoaicite:9
Example
Plot a DEM array
- Connect a DEM array (e.g., from Read DEM or a terrain attribute output) to Dem Array.
- Set:
run = Trueaxes = Falsewidth = 10,height = 6colour = inferno(or any other colormap)
- The node will display the DEM using:
rd.rdShow(dem_array, ignore_colours=[0], axes=axes, cmap=colour, figsize=(width, height)) :contentReferenceoaicite:10
Notes / gotchas
- Plotting only happens when run is enabled; otherwise the node does nothing beyond reading the input. :contentReferenceoaicite:11
ignore_colours=[0]may hide/neutralise zero-valued pixels (often used for NoData masks in some DEM pipelines). :contentReferenceoaicite:12