Slope, Aspect, and Hillshade
Derive terrain analysis products from Digital Elevation Models in QGIS
Tutorial: DEM Derivatives - Slope, Aspect & Hillshade
Master terrain analysis by deriving professional-grade slope, aspect, curvature, and hillshade products from Digital Elevation Models.
Learning Objectives
π Learning Path: Objectives β Steps
| Objective | Related Step | Time | Key Outcome |
|---|---|---|---|
| π― Calculate slope & aspect | Step 1: Slope & Aspect | 15 min | Slope and aspect rasters |
| π― Create hillshade | Step 2: Hillshade | 15 min | Shaded relief visualization |
| π― Derive curvature | Step 3: Curvature | 15 min | Curvature and morphology |
| π― Combine derivatives | Step 4: Multivariate Analysis | 15 min | Integrated analysis |
| π― Style for publication | Step 5: Styling & Symbolization | 15 min | Professional cartography |
Workflow Summary
This tutorial follows these key steps:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 1: Slope & Aspect Calculation β
β What: Derive basic terrain parameters β
β Time: ~15 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 2: Hillshade Creation β
β What: Generate shaded relief for visualization β
β Time: ~15 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 3: Curvature Derivatives β
β What: Calculate terrain curvature products β
β Time: ~15 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 4: Multivariate Analysis β
β What: Combine derivatives for integrated analysis β
β Time: ~15 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 5: Styling & Symbolization β
β What: Create publication-ready maps β
β Time: ~15 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RESULT: Complete DEM analysis package β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Prerequisites & Requirements
Data & Resources
What you need:
| Resource | Type | Purpose |
|---|---|---|
| Clipped DEM | GeoTIFF raster | Input for all derivatives |
| Study Area Shapefile | Vector boundary | For clipping outputs (optional) |
| QGIS GDAL Tools | Built-in | Processing algorithms |
Optional reference materials: - QGIS Raster Analysis Documentation: https://docs.qgis.org/latest/en/docs/user_manual/processing_algs/qgis/rasteranalysis.html - Terrain Analysis Basics: https://en.wikipedia.org/wiki/Digital_elevation_model - Slope/Aspect Standards: https://pubs.usgs.gov/pp/p1395/report.pdf
Step-by-Step Instructions
Achieves: β Learning Objective 1: Calculate slope and aspect
What youβll do: Derive slope and aspect rasters from your DEM, which are fundamental terrain parameters used in countless analyses.
1.1 β Understanding Slope and Aspect
Slope measures terrain steepness (in degrees or percent). Aspect measures terrain orientation (0-360Β°, where 0Β° = North).
These are calculated using the elevation gradients in the raster: - Slope = rate of maximum elevation change - Aspect = direction of maximum elevation change
1.2 β Calculate Slope
QGIS Raster Menu
Raster
β Analysis
β Slope
Configuration:
| Parameter | Setting | Notes |
|---|---|---|
| Input layer | dem_clipped.tif | Your DEM raster |
| Z factor | 1.0 | Default; increase for exaggeration |
| Output layer | slope_degrees.tif | Output filename |
Important: Choose degrees for accessibility (0-90Β°) rather than percent for professional analysis.
Click Run. QGIS calculates slope for every cell based on neighboring elevation values.
1.3 β Calculate Aspect
QGIS Raster Menu
Raster
β Analysis
β Aspect
Configuration:
| Parameter | Setting |
|---|---|
| Input layer | dem_clipped.tif |
| Output layer | aspect.tif |
Aspect interpretation: - 0Β° / 360Β° = North - 90Β° = East - 180Β° = South - 270Β° = West

1.4 β Interpret and Classify Results
Slope classification for terrain analysis:
| Slope Range | Terrain Type | Characteristics |
|---|---|---|
| 0-2Β° | Flat/plains | Prone to flooding, poor drainage |
| 2-5Β° | Gentle slopes | Suitable for agriculture |
| 5-15Β° | Moderate slopes | Good for development with care |
| 15-30Β° | Steep slopes | Erosion risk, landslide hazard |
| 30Β°+ | Very steep | Mountainous, unstable |
Pro Tip: Slope values >30Β° are typically unsuitable for building and prone to landslides, but excellent for identifying geological hazards.
β Back to Learning Objectives
Achieves: β Learning Objective 2: Create hillshade visualizations
What youβll do: Generate a shaded relief visualization that makes terrain features visually apparent and professional-looking.
2.1 β Understanding Hillshade
Hillshade simulates lighting effects on terrain, making subtle variations visible. Itβs created by calculating slope and aspect, then combining them with a light source direction (typically from the northwest at 45Β° angle).
2.2 β Generate Hillshade
QGIS Raster Menu
Raster
β Analysis
β Hillshade
Configuration:
| Parameter | Setting | Explanation |
|---|---|---|
| Input layer | dem_clipped.tif | Your DEM |
| Z factor | 1.5 | Exaggeration (1-3 typical) |
| Azimuth of light | 315 | Direction from top-left (0-360Β°) |
| Vertical angle | 45 | Height angle of light source (0-90Β°) |
| Output layer | hillshade.tif | Output filename |
Light source explained: - Azimuth 315Β° = light from northwest (standard for Northern Hemisphere) - Vertical angle 45Β° = light from above at 45Β° (default, good visibility)
Click Run. QGIS creates grayscale hillshade (0-255 values).
2.3 β Enhanced Hillshade (Optional)
For better visual impact, combine hillshade with original DEM or slope data:
- Load hillshade layer
- Set Blend Mode to βMultiplyβ or βOverlayβ
- Adjust Opacity to 60-80%
- Stack with slope or DEM underneath
This creates dramatic terrain visualization!

2.4 β Professional Hillshade Tips
- Exaggerate Z-factor (2-3) for small areas with subtle terrain
- Use Z=1 for large areas to avoid visual distortion
- Flip azimuth to 135Β° for Southern Hemisphere (opposite lighting)
- Stack multiple hillshades with different azimuths for better detail
β Back to Learning Objectives
Achieves: β Learning Objective 3: Derive curvature and plan/profile curvature
What youβll do: Calculate terrain curvature to identify topographic features like ridges, valleys, and saddle points.
3.1 β Understanding Curvature
Curvature measures how much terrain bends (concave/convex):
- Positive values = convex slopes (ridges)
- Negative values = concave slopes (valleys)
- Zero values = straight slopes
Plan Curvature = horizontal curvature (side-to-side)
Profile Curvature = vertical curvature (up-down)
3.2 β Calculate Plan Curvature
QGIS Processing Toolbox
Search for βPlan Curvatureβ in the Processing Toolbox.
Configuration:
| Parameter | Setting |
|---|---|
| Input DEM | dem_clipped.tif |
| Output layer | plan_curvature.tif |
Plan Curvature interpretation: - Ridge areas show positive values (bright colors) - Valley areas show negative values (dark colors) - Used for identifying water accumulation patterns
3.3 β Calculate Profile Curvature
Search for βProfile Curvatureβ in the Processing Toolbox.
Configuration:
| Parameter | Setting |
|---|---|
| Input DEM | dem_clipped.tif |
| Output layer | profile_curvature.tif |
Profile Curvature interpretation: - Positive = slope becomes steeper downhill - Negative = slope becomes gentler downhill - Used for erosion and water flow modeling
3.4 β Terrain Classification Using Curvature
Combine curvature products to classify landforms:
Ridge areas: Plan > 0, Profile > 0
Valley areas: Plan < 0, Profile < 0
Slopes: Plan β 0, Profile varies
Saddle points: Plan > 0, Profile < 0

β Back to Learning Objectives
Achieves: β Learning Objective 4: Combine derivatives for multivariate analysis
What youβll do: Integrate multiple DEM derivatives to create comprehensive terrain analysis products.
4.1 β Terrain Position Index (TPI)
TPI classifies terrain based on elevation relative to surrounding areas:
QGIS Processing Toolbox
Search for βTerrain Position Indexβ or use Raster Calculator:
TPI = DEM - FOCUS_OPERATION(DEM, "mean", radius=100)
TPI interpretation: - TPI > 0 = ridges and peaks - TPI β 0 = slopes and flats - TPI < 0 = valleys and depressions
4.2 β Topographic Ruggedness Index (TRI)
TRI measures roughness of terrain (standard deviation of slope):
QGIS Raster Calculator
TRI = SQRT(slope_xΒ² + slope_yΒ²)
TRI applications: - Identify rough/mountainous terrain - Assess terrain accessibility - Hazard zone identification
4.3 β Combined Terrain Classification
Create a multivariate classification using multiple derivatives:
QGIS Raster Calculator
Terrain_Class = IF(slope < 5, 1, # Flat
IF(slope < 15, 2, # Gentle
IF(slope < 30, 3, # Steep
4))) # Very Steep
Then refine by aspect for exposure: - North-facing = cooler, shadier - South-facing = warmer, sunnier - E/W = transitional

4.4 β Landslide Hazard Assessment (Example Application)
Combine derivatives for hazard mapping:
Hazard = HIGH if (slope > 30Β° AND
plan_curvature < 0 AND
profile_curvature > 0)
This identifies valleys with steepening slopes = high hazard zones.
β Back to Learning Objectives
Achieves: β Learning Objective 5: Style DEM derivatives for publication
What youβll do: Apply professional styling to DEM derivatives for cartographic publication.
5.1 β Color Ramps for Slope
Best practices for slope visualization:
QGIS Layer Properties
Symbology
β Raster
β Render type: Singleband pseudocolor
Recommended color schemes:
| Slope Range | Color | Meaning |
|---|---|---|
| 0-5Β° | Green | Safe, buildable |
| 5-15Β° | Yellow | Caution |
| 15-30Β° | Orange | Risk |
| 30Β°+ | Red | Hazard |
QGIS provides presets: βViridisβ, βPlasmaβ, βRdYlGn_rβ (good for slope)
5.2 β Aspect Circular Color Ramp
Aspect is circular data (0-360Β° = same as 360-0Β°), so use circular color ramps:
QGIS Aspect Styling
Symbology
β Raster
β Color ramp: "Spectral" (circular)
Standard aspect colors: - North (0Β°) = Purple - East (90Β°) = Green - South (180Β°) = Yellow - West (270Β°) = Red
5.3 β Hillshade as Background Layer
Layer stack for professional maps:
Top: Vector overlays (shapefiles, contours)
β
Mid: Slope or curvature (with transparency)
β
Bottom: Hillshade (grayscale background)
Configuration: 1. Set hillshade Blend Mode to βMultiplyβ 2. Set derivative Opacity to 60-75% 3. Enable vector borders for clarity
5.4 β Add Legend and Metadata
QGIS Composer/Print Layout
Add Legend
β Include all derivative layers
β Add title, scale, north arrow
β Add metadata box explaining:
- Data source (SRTM, LiDAR, etc.)
- Processing method
- Color scheme meaning
- Derived date
Professional cartography requirements: - β Clear legend with units (degrees, percent) - β Scale bar visible - β North arrow oriented correctly - β Data source and processing date noted - β CRS/Projection clearly labeled

5.5 β Export for Publication
QGIS Export Options
For printed maps:
File
β Export as Image
β PNG at 300 DPI
β Or PDF for vector export
For web/presentations:
File
β Export as Image
β PNG at 150 DPI
β Or export QML style for web GIS
Pro Tips: - Export as GeoTIFF to maintain georeference - Use PDF for reports (vector text, smaller files) - Test on color-blind palette (use βCividisβ colormap)
Result & Expected Outcome
What you should have now:
β
Slope raster (degrees, 0-90Β°)
β
Aspect raster (direction, 0-360Β°)
β
Hillshade layer (grayscale relief)
β
Curvature products (plan & profile)
β
Publication-ready maps with proper styling
Your complete DEM derivatives package:
dem_derivatives/
βββ slope/
β βββ slope_degrees.tif
β βββ slope_classified.tif
β βββ slope_percent.tif
βββ aspect/
β βββ aspect.tif
β βββ aspect_classified.tif
β βββ shaded_relief.tif
βββ curvature/
β βββ plan_curvature.tif
β βββ profile_curvature.tif
β βββ terrain_position_index.tif
β βββ terrain_ruggedness_index.tif
βββ integrated_analysis/
β βββ terrain_classification.tif
β βββ landslide_hazard.tif
β βββ sunlight_exposure.tif
βββ maps/
βββ slope_map.pdf
βββ aspect_map.pdf
βββ hillshade_composite.pdf
βββ terrain_analysis_summary.pdf
Applications of your derivatives: - ποΈ Site suitability for construction - π§ Hydrological flow modeling - π³ Vegetation and landcover analysis - β οΈ Hazard assessment (landslides, avalanches) - πΊοΈ Terrain-based mapping and planning - π¬ Geomorphological research
Exercises & Challenges
Challenge 1: Intermediate β Classify Slope for Land Use Planning
π‘ Create Land Use Suitability Map Intermediate
Objective: Create a slope-based land use classification suitable for urban planning.
Your task:
- Calculate slope from your DEM
- Create 5 classes: Flat (<5Β°), Buildable (5-15Β°), Limited (15-30Β°), Restricted (30-45Β°), Prohibited (>45Β°)
- Assign colors: Green (best) β Red (worst)
- Overlay with existing land use shapefile
- Identify conflicts and suitable areas for development
Hint: Use Raster Calculator with nested IF statements for classification.
Solution (click to reveal):
# In QGIS Raster Calculator:
IF(slope < 5, 1,
IF(slope < 15, 2,
IF(slope < 30, 3,
IF(slope < 45, 4, 5))))Then apply color ramp: Green (1) β Yellow (2) β Orange (3) β Red (4-5)
Interpretation: Green areas are safest for building. Red areas require special engineering or are unbuildable.
Challenge 2: Intermediate β Identify Ridges and Valleys
π‘ Geomorphological Feature Mapping Intermediate
Objective: Extract and map ridge lines, valley lines, and saddle points.
Your task:
- Calculate plan curvature from your DEM
- Ridges: Identify areas where plan_curvature > 0.5 AND slope > 10Β°
- Valleys: Identify areas where plan_curvature < -0.5
- Saddle points: Identify areas where aspect changes abruptly
- Vectorize and map these features
- Verify against hillshade for visual accuracy
Resources: - QGIS Raster to Vector conversion: https://docs.qgis.org/latest/en/docs/user_manual/processing_algs/qgis/rasteranalysis.html - Terrain morphometry guide: https://en.wikipedia.org/wiki/Terrain_morphology
Tips, Tricks & Warnings
π‘ Pro Tips
β οΈ Common Pitfalls
π΄ Critical Warnings
These mistakes can invalidate your analysis:
β οΈ Never use geographic coordinates (lat/lon) for slope/aspect! Results will be completely wrong:
β WRONG: EPSG:4326 (WGS 84 lat/lon)
β
CORRECT: EPSG:32632 (WGS 84 / UTM zone 32N)
Always reproject to projected CRS before calculating derivatives.
β οΈ Check DEM vertical units match horizontal! Mismatched units cause wrong slope values:
Example: 30m resolution DEM but elevation in feet
Result: Slope values 3x too large!
Verify: DEM resolution and units should be consistent (e.g., both in meters).
β οΈ Document your Z-factor choice! Always note the Z-factor used in metadata. Different Z-factors make results non-comparable between studies.
References & Further Reading
Questions or Issues?
If you encounter problems:
- Verify your DEM: Check for nodata values, data spikes, or negative elevations
- Check CRS: Confirm youβre using projected coordinates, not lat/lon
- Test on subset: Verify workflow on small area before processing entire DEM
- Review QGIS documentation: https://docs.qgis.org/
- Ask GIS Stack Exchange: https://gis.stackexchange.com/ with [qgis] tag
Common issues:
| Issue | Solution |
|---|---|
| Slope values unrealistic (>90Β°) | Check that DEM CRS is projected (UTM, not lat/lon) |
| Hillshade shows artifacts | Smooth DEM with Gaussian filter before calculating |
| Aspect values wrap at 0Β°/360Β° | Use circular statistics, not standard mean |
| Curvature shows noise | Increase search radius or smooth DEM first |
Tutorial Version: 1.0
Last Updated: February 5, 2025
Difficulty: Intermediate
Estimated Duration: 75 minutes
Status: β
Complete and tested in QGIS 3.28.0
Prerequisites: Completion of βWorking with Terrain Dataβ tutorial recommended but not required (any processed DEM works).