← All tutorials · RavingDesk

Tutorial 15 of 15

Terrain, streams, watersheds and profiles

Intermediate 9 min

Open an elevation model in a Terrain step, read shaded relief, slope and contours, click a pour point for its watershed, draw an elevation profile along a trail, check a viewshed and export maps, GeoJSON and a 3D model for Renderloom.

Open the terrain example

Open the example Terrain and drainage of synthetic hills. Its step Relief, streams and watershed is a Terrain step. The elevation model is synthetic (not real data) and placed at 0° N, 0° E only so that coordinates work. The dataset Trail over the synthetic hills (example data) holds three points with place, lat and lon.

The step runs in your browser. Every setting redraws the map at once; there is no Run button.

Open your own elevation model

Under Elevation model, press Open elevation file… and choose an ESRI ASCII grid (.asc), an XYZ grid, a GeoTIFF or a PNG heightmap. GeoTIFFs must hold one band of Int16, UInt16 or Float32 heights, uncompressed or Deflate, in WGS84 longitude/latitude or a WGS84 UTM zone. Other files are refused with a reason.

Open Import options first when your file needs them: Coordinate system of ASCII and XYZ grids (for example a UTM zone such as 33N), PNG heightmap encoding (Terrarium, Mapbox Terrain-RGB or grey values), Cell size of a PNG heightmap (m) and the elevations of black and white in a grey PNG. Grids above 262,144 cells are block-averaged, and a message says by how much. To try things out, choose an Example terrain and press Load example terrain. Both actions can be undone with Ctrl+Z.

Read the map

Map layer switches between Elevation (shaded relief), Hillshade, Slope, Aspect (direction the slope faces), Curvature, Flow accumulation, Filled depressions and Viewshed from the observer. Sun azimuth (°) and Sun altitude (°) move the light of the shading; Z factor scales the heights (0.3048 for feet). Contour interval (m) sets the contour lines; empty picks a round interval.

Under the map, the cards show Elevation range (247.3 – 480.6 m here), Mean slope (5.59°), Steepest slope and Closed depressions (473 cells, up to 29.11 m deep). Open Slope classes and aspect for the shares of flat to steep ground and of each compass direction.

Click a pour point for its watershed

Clicking the map sets decides what a click does: The pour point (watershed outlet), The observer (viewshed) or The next profile point. With the pour point selected, click a valley: the yellow outline shows the area that drains through that cell, and the blue lines are the streams (thicker = higher Strahler order). The example's Pour point is row 72, col 91; the cards show Watershed area 2.97 km² and Longest flow path 3.76 km.

The keyboard works too: focus the map, move the cursor with the arrow keys (Shift moves 10 cells) and press Enter. The line under the map reads the elevation, slope and upstream cells of the cursor cell.

Snap the pour point within (cells) moves the point to the strongest flow nearby. Stream threshold (upstream cells) decides how many upstream cells make a stream.

Draw an elevation profile

Type points into Profile points (one per line), click them on the map, or choose a dataset under Or follow the route of a dataset. The example follows the trail: the chart below the map shows the profile with the points A, B and C, and the cards show Profile length 2.5 km and Climb / descent. Distances are measured on the WGS84 ellipsoid.

Viewshed and cut and fill

An Observer (here the summit, 2 m above the ground) gives the card Visible from the observer: 42.4 % of the area. Choose the Viewshed from the observer layer to see it; Earth curvature and refraction (k = 0.13) matters for long distances. A Reference elevation (m) adds Cut and Fill volumes against a level plane.

Export and continue in Renderloom

The buttons under the cards download PNG and SVG maps, Contours (GeoJSON), Streams (GeoJSON), Watershed (GeoJSON), Profile (CSV), the grid as Grid (ASC) or Grid (GeoTIFF), and 3D model (OBJ). Open in Renderloom hands the heightfield to Renderloom's Mesh Lab.

The same engine runs the tools RavingDesk Terrain Analyzer, RavingDesk Watershed & Stream Network and RavingDesk Elevation Profile from a DEM, also through the API and MCP. A Terrain step appears in the data report with its map and one sentence about the watershed and the profile.

Ready to try it?

Launch RavingDesk →