Terrain & elevation
Working with DEMs: slope, aspect, hillshade, contours, profiles and drainage.
Everything on Spatial Workflow about terrain & elevation, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 42 guides in total.
7 learning paths run through this topic — follow one if you would rather work through a route than pick a single guide.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
- Digital Elevation Models Explained: DEM, DSM and DTM dem dsm dtm explained
- Vertical Datums Explained: Why Your Elevations Are Off vertical datum explained
- Slope and Aspect Explained: How They Are Computed from a Grid slope aspect explained
- DSM, DTM and CHM from LiDAR: How Each Surface Is Derived lidar surfaces dsm dtm chm explained
- DEM Hydrology Explained: From Elevation to Where Water Goes dem hydrology explained
- Flow Direction Explained: D8, D-Infinity and MFD Compared d8 flow direction explained
- Pour Points Explained: Why Watershed Delineation Needs a Snapped Outlet pour point snapping explained
- How DEM Resolution and Source Change a Drainage Network dem resolution stream network
- Height Above Nearest Drainage Explained: A Quick Flood Proxy hand height above nearest drainage
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Calculate Slope and Aspect from a DEM in Python calculate slope python dem
- How to Make a Hillshade from a DEM in Python hillshade python
- How to Generate Contour Lines from a DEM in Python generate contours python
- How to Extract an Elevation Profile Along a Line in Python elevation profile python
- How to Fill Sinks and Derive Flow Direction from a DEM fill sinks flow direction python
- How to Calculate a Viewshed in Python viewshed python
- How to Create a DTM from LiDAR Ground Points in Python create dtm from lidar python
- How to Create a Canopy Height Model from LiDAR canopy height model python
- How to Measure Building Heights from LiDAR in Python building heights from lidar python
- How to Build a TIN and Interpolate Elevations tin interpolation python
- How to Run a Weighted Site Suitability Analysis in Python suitability analysis python raster
- How to Condition a DEM for Hydrology: Breaching or Filling breach depressions dem python
- How to Calculate Flow Accumulation from a DEM in Python flow accumulation python
- How to Delineate a Watershed from a Pour Point in Python watershed delineation python
- How to Extract a Stream Network from a DEM extract streams from dem python
- How to Calculate Strahler Stream Order in Python strahler order python
- How to Split a Catchment into Sub-basins at Many Outlets delineate subbasins python
- How to Summarise Catchment Attributes: Area, Slope and Land Cover catchment characteristics python
- How to Calculate Height Above Nearest Drainage (HAND) in Python hand python dem
- How to Burn a Known River Network into a DEM stream burning dem python
- How to test whether a window can see a landmark 3d line of sight python
- How to map coastal inundation from a DEM in Python coastal inundation mapping python
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- Slope Values Are Wrong or Absurdly Steep slope values wrong
- Hillshade Looks Flat, Washed Out or Inverted hillshade inverted
- Contours Come Out Jagged or Full of Tiny Rings contours jagged noisy
- My LiDAR DTM Has Holes, Spikes or Terraces lidar dtm holes and spikes
- Fixing a Watershed That Comes Out as a Few Pixels watershed delineation wrong small
- Fixing Streams That Run in Straight Parallel Lines Across Flat Ground flow direction flat areas parallel streams
- Fixing Flow Accumulation That Is All Zeros, NoData or Stops at the Edge flow accumulation nodata
- Fixing Streams That Stop at Roads, Bridges and Embankments dem roads block flow bridges
- Fixing Catchment Areas That Are Wrong on a Latitude–Longitude DEM watershed area geographic crs wrong
- Extruded buildings float above or sink into the ground extruded buildings float terrain
- An inundation map floods inland areas that cannot flood bathtub inundation wrong
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
-
Terrain & Elevation
Turn a grid of heights into slope, shade, contours and drainage.
Open path → -
LiDAR & Point Clouds
Millions of points, and the surfaces worth deriving from them.
Open path → -
Interpolation & Surfaces
A continuous surface from scattered samples, with its support attached.
Open path → -
Location & Accessibility
Who can reach what — and where the next site should go.
Open path → -
Hydrology & Watersheds
A DEM already knows where the water goes. Ask it carefully.
Open path → -
3D & Buildings
A footprint plus a height is not a building, but it is most of one.
Open path → -
Coastal & Marine
The shoreline is a choice of datum, not a line on a map.
Open path →
Related topics
Subjects that keep coming up alongside this one, most overlap first.