DEM aspect, the way the ground faces
The aspect at the center of a 3 x 3 elevation window: the downslope direction clockwise from north, by Horn's method as gdaldem computes it.
The ground falls toward the north-east.
- Aspect
Provenance
- Computed by
- raster.terrain.aspect 1.0.0, core 0.1.0
- Model
- Horn's (1981) eight-neighbor gradients, aspect = 90 - atan2(dz/dy, -dz/dx) in degrees, clockwise from north and downslope, as in raster.terrain.slope-aspect; none where both gradients are zero
- Accuracy
- Exact evaluation of Horn's formulas. On a degree-based grid the cell sizes come from the WGS 84 meridian and prime-vertical radii at the latitude given.
- Notes
- None
- Cites
- Horn, B. K. P., Proceedings of the IEEE, Hill shading and the reflectance map
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: Horn's (1981) eight-neighbor gradients, aspect = 90 - atan2(dz/dy, -dz/dx) in degrees, clockwise from north and downslope, as in raster.terrain.slope-aspect; none where both gradients are zero
Accuracy: Exact evaluation of Horn's formulas. On a degree-based grid the cell sizes come from the WGS 84 meridian and prime-vertical radii at the latitude given.
When to use this: Use this to find which way a piece of ground faces: for sun on a solar site or a garden, snow and ice that lingers on north-facing slopes, or a check of one cell in an aspect raster. Enter the nine elevations around the cell and the cell size. The answer is the compass direction the ground falls toward.
Limitations: It works on the nine elevations you give, not on a raster. On nearly flat ground the aspect swings with small errors in the elevations, so treat it as unreliable under about half a degree of slope; a window with no slope at all has no aspect and is reported as flat.
Worked example: A 10 m window falling to the north-east. Source: Horn's formulas in Python, checked against gdaldem 3.13.3 (tools/vectors/gen_terrain_views.py).
You enter
- Cell size
- 10 m
- Elevation window
- 500, 498, 495 503, 500, 497 507, 504, 500
You get
- Facing
- north-east
- Aspect
- 45°
Review: Not yet independently reviewed by a GIS professional.
Last verified: 2026-09-22, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.0, core 0.1.0. See this tool in the verification report.
Changes
- 2026-10-14, changed: Slope, aspect, hillshade, the terrain ruggedness index, and the topographic position index, each as its own tool, are now stable. Each matches gdaldem 3.13.3 on 24 windows (hillshade exactly; the rest within gdaldem's 32-bit rounding) and its parent tool on 208 fixture windows, with invariant tests for turning, raising, and inverting the ground. Results are unchanged. Changelog
Checked against: 25 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Constants this tool assumes
Values you do not enter, and where each comes from.
- WGS 84 semi-major axis, for cell sizes given in degrees
6378137 m— Department of Defense World Geodetic System 1984- WGS 84 inverse flattening, for cell sizes given in degrees
298.257223563— Department of Defense World Geodetic System 1984
Sources
- Hill shading and the reflectance map, Horn, B. K. P., Proceedings of the IEEE, Volume 69, issue 1, pages 14-47. The eight-neighbor gradient estimate used for slope, aspect, and hill shading.
Terms
- DEM: digital elevation model
- A grid of elevations. A surface model includes buildings and canopy; a terrain model is the ground beneath them. Source: Copernicus DEM GLO-30