GIS Tools

Language

Made withfor the GIS community

Slope/Aspect Calculator

Calculate slope and aspect from elevation data

Raster Tools

Drop DEM GeoTIFF here

Single-band elevation data

Load a DEM GeoTIFF to calculate slope/aspect

About Slope & Aspect

  • β€’ Slope measures the steepness of terrain
  • β€’ Aspect indicates the compass direction a slope faces
  • β€’ Both use Horn's method with a 3Γ—3 neighborhood
  • β€’ Useful for terrain analysis, hydrology, and visibility studies

What Are Slope and Aspect?

Slope and aspect are the two fundamental first-derivative terrain attributes computed from a Digital Elevation Model (DEM). Slope measures how steep the ground is at each cell β€” the rate of change of elevation per unit horizontal distance β€” typically expressed in degrees from horizontal (0 to 90) or as a percent rise. Aspect measures the direction the slope is facing β€” the compass bearing of the steepest downhill direction β€” expressed as degrees clockwise from north (0 to 360), with flat areas conventionally given a value of -1 or null.

The Slope/Aspect Calculator on gis.tools takes a DEM GeoTIFF and computes both rasters in the browser, using Horn's 3x3 finite-difference method that mirrors gdaldem slope and gdaldem aspect. People search for "slope aspect dem", "calculate slope from dem", "aspect raster", "qgis slope tool" and "gis slope analysis" because these two derivatives feed into nearly every downstream terrain analysis: hydrology, ecology, avalanche forecasting, solar potential modelling, soil mapping, civil engineering and military terrain assessment.

Together, slope and aspect convert a featureless elevation grid into geomorphologically meaningful surfaces. A slope raster lights up steep cliffs and gentle plains; an aspect raster reveals which hillsides catch the morning sun and which stay in afternoon shade.

How Slope and Aspect Are Calculated

The standard algorithm β€” Horn's method, formalised in 1981 β€” uses a 3x3 moving window centred on each cell. It estimates the partial derivatives of elevation in the X and Y directions using a weighted finite difference, then combines them into slope magnitude and aspect direction.

Horn's Finite Difference

Label the nine cells in the 3x3 neighbourhood as a b c / d e f / g h i where e is the centre. The X derivative is dz/dx = ((c + 2f + i) - (a + 2d + g)) / (8 * cellsize_x). The Y derivative is dz/dy = ((g + 2h + i) - (a + 2b + c)) / (8 * cellsize_y). These weighted differences give greater influence to the four orthogonal neighbours and less to the diagonals.

From Derivatives to Slope

Slope in radians is atan(sqrt(dz/dx^2 + dz/dy^2)), converted to degrees by multiplying by 180/pi. Slope as a percentage is 100 * sqrt(dz/dx^2 + dz/dy^2).

From Derivatives to Aspect

Aspect in radians is atan2(dz/dy, -dz/dx). The result is converted to degrees clockwise from north (0-360). Cells with zero slope are flat and aspect is undefined β€” typically encoded as -1 or NaN.

Alternative Methods

Other algorithms exist, including Zevenbergen-Thorne (which uses only the four orthogonal neighbours) and second-degree polynomial fitting. Horn's method is the GDAL/ArcGIS/QGIS default because it is robust to noise and produces visually consistent results.

Key Parameters and Options

Output Units for Slope

Choose degrees (0-90) or percent rise (0 to infinity, where 100% is a 45-degree slope). Degrees are the default for ecological and avalanche applications; percent is favoured by civil engineering and road design.

Z-Factor

The conversion factor between vertical elevation units and horizontal map units. For a DEM in metres on a metric projected CRS, the z-factor is 1. For a DEM in metres on a geographic CRS (degrees), apply approximately 1/111320 at the equator, scaled by the cosine of latitude β€” or better, reproject the DEM to a metric CRS before computing slope.

Aspect Convention

Most modern tools use compass aspect (clockwise from north). Some legacy tools use mathematical aspect (counterclockwise from east). The gis.tools calculator follows the GDAL convention: clockwise from north.

Flat Cell Handling

Cells with no slope have an undefined aspect. The output uses -1 (GDAL convention) or NaN to flag these.

Edge Behaviour

The 3x3 window cannot be evaluated on the outermost row and column; these edge cells are either set to nodata or computed with a smaller kernel.

Practical Applications

Avalanche Forecasting

Avalanche centres routinely produce slope-angle shading and aspect-coloured maps for backcountry skiers. Slopes between 30 and 45 degrees are the avalanche sweet spot; cross-referencing slope with aspect identifies wind-loaded leeward starting zones. Forecasters in places like the CAIC, SAIS and Avalanche Canada use these layers daily.

Solar Potential and Microclimate

Aspect controls how much direct sun a hillside receives. South-facing slopes (in the northern hemisphere) accumulate more solar energy and are warmer, drier and earlier to lose snow than north-facing slopes. Solar engineers use aspect plus slope to model rooftop and field-scale solar PV potential.

Wildlife Habitat Modelling

Many species track aspect for thermal preference. North-facing slopes hold cooler microclimates that favour conifers, ferns and amphibians; south-facing slopes favour grasslands, reptiles and drought-adapted shrubs. Ecologists use aspect rasters as covariates in species distribution models.

Hydrology and Erosion Modelling

Slope is the primary control on overland flow velocity, erosion potential, the Universal Soil Loss Equation (USLE) and watershed delineation. The slope raster feeds directly into D8 and D-infinity flow routing algorithms.

Civil Engineering and Road Design

Highway planners need slopes below regulatory grades (typically under 6% for interstates, 8-10% for rural roads). Slope rasters help identify cost-effective alignments and avoid prohibitively steep cuts.

Forestry and Timber Cruising

Operators avoid skid trails on slopes above 30 percent because of erosion and equipment safety risks. Slope rasters guide harvest planning and riparian buffer placement.

Military and Off-Road Mobility

Tactical mobility models use slope thresholds to classify terrain as "go", "slow go" and "no go" for vehicles, and aspect informs concealment and shadow analysis.

Step-by-Step Workflow in gis.tools

  1. Open the Slope/Aspect Calculator on gis.tools.
  2. Drag a DEM GeoTIFF into the page. The file is parsed in the browser; nothing is uploaded.
  3. The tool detects the cell size, units and CRS. If your DEM is in degrees, the tool warns you and suggests reprojecting first.
  4. Choose the output: slope only, aspect only, or both. Pick units (degrees or percent).
  5. Click Calculate. Horn's 3x3 method runs over the entire raster and produces one or two new GeoTIFFs.
  6. Preview the slope raster with a colour ramp (white-to-red works well) and the aspect raster with a circular colour wheel.
  7. Export the rasters as GeoTIFF (preserving georeferencing) for downstream analysis in QGIS, ArcGIS or Python.
  8. Combine with the Hillshade Generator, Raster to Contours or Zonal Statistics for richer terrain products.

Worked Example: Avalanche Terrain Classification in the Tetons

You download a 10 m DEM tile covering the central Tetons in Wyoming and load it into the Slope/Aspect Calculator. The tool detects the metric UTM CRS and runs without a z-factor adjustment. After a few seconds you have a slope raster (0-72 degrees) and an aspect raster (0-360 with -1 for flats). You apply a colour ramp that highlights the 30-45 degree slope band as orange-red and overlay it on the Hillshade of the same DEM. The east and north-facing 30-45 degree slopes light up β€” exactly the wind-loaded leeward terrain that avalanche forecasters flag as suspect after a westerly storm. You export the slope raster and use Zonal Statistics to summarise mean slope inside named drainage polygons.

Common Pitfalls and Gotchas

  • DEM in geographic coordinates without a z-factor produces wildly wrong slopes β€” always reproject to a metric CRS first.
  • Float DEMs with NaN nodata may produce edge artefacts; explicitly set the nodata value.
  • Stair-stepping in integer DEMs (Int16) shows up as artefactual slope spikes; use Float32 input where possible.
  • Aspect for nearly-flat cells is meaningless β€” small derivative noise can rotate aspect through any direction. Filter out cells with slope below 1-2 degrees before using aspect statistics.
  • The aspect colour wheel must be cyclic (0 and 360 are the same colour) or you get a discontinuity at north.
  • Outermost row and column cannot be computed; expect a 1-pixel border of nodata.
  • Don't confuse slope in degrees with slope in percent β€” a 45-degree slope is 100 percent, not 45 percent.
  • High-resolution Lidar DEMs may show slopes from individual tree branches, vehicles or buildings; use a bare-earth DTM, not a DSM.

Tips for Best Results

  • Reproject DEMs to a local UTM zone or national grid before computing slope to keep horizontal and vertical units consistent.
  • Use a Float32 DEM rather than Int16 to preserve sub-metre elevation gradients on gentle slopes.
  • Pair slope and aspect with a hillshade β€” three rasters together deliver complete terrain interpretation.
  • For solar potential, classify aspect into 8 cardinal sectors and overlay onto slope classes.
  • For ecological work, use aspect cosine (north-south) and aspect sine (east-west) as continuous covariates instead of raw degrees.
  • Smooth noisy DEMs with a low-pass filter before slope calculation if your data has stair-stepping artefacts.
  • Always check the output range β€” slopes above 89 degrees indicate cliffs or DEM errors.
  • Visualise aspect with a circular colour scheme so the wraparound at north reads naturally.

Comparison with Other GIS Approaches

GDAL's gdaldem slope and gdaldem aspect are the canonical command-line implementations and use Horn's method with optional Zevenbergen-Thorne. ArcGIS Spatial Analyst's Slope and Aspect tools produce identical results. QGIS exposes both via the Raster Terrain Analysis menu, GRASS via r.slope.aspect. The Slope/Aspect Calculator on gis.tools matches these reference implementations to within floating-point precision. The advantage is browser-side execution: no install, no upload, instant feedback, with seamless handoff to the rest of the gis.tools raster suite.

Performance Considerations

Slope and aspect are local operations like hillshade β€” each output cell depends only on its 3x3 neighbourhood β€” so the computation is linear in the number of pixels. A 4000x4000 DEM finishes in roughly a second on modern hardware. Larger files (tens of millions of pixels) take a few seconds. For multi-gigabyte DEMs, downsample with Raster Resampler or clip to your area of interest with Clip Raster by Polygon first.

Data Privacy and Browser-Based Processing

Your DEM is read with the File API, decoded in WebAssembly, processed in JavaScript typed arrays and exported via a download blob β€” never uploaded. There are no server requests, no telemetry and no logged file metadata. This is essential for proprietary Lidar surveys, classified terrain models, sensitive archaeological sites and any environment where data residency rules forbid third-party uploads.

Related GIS Concepts

Curvature: The second derivative of elevation. Profile curvature describes change in slope along the steepest direction; planform curvature describes change in aspect across the slope. Together they distinguish ridges from valleys and convex from concave shapes.

Roughness and Topographic Position Index (TPI): Higher-order terrain metrics that compare a cell's elevation to its neighbourhood mean.

Topographic Wetness Index (TWI): A composite index that combines slope and contributing area to predict where water accumulates.

Hillshade: A visual product derived from slope and aspect plus a sun position; see the Hillshade Generator.

Flow Direction (D8 / D-infinity): A discretisation of aspect tailored for hydrology β€” used for watershed delineation and stream network extraction.

Frequently Asked Questions

What units does the slope output use?

Degrees by default (0 to 90); you can also choose percent rise.

Why is my aspect raster random in flat areas?

Aspect is undefined where slope is zero. The tool flags flat cells with -1 (GDAL convention). Filter them out before computing aspect statistics.

Can I compute slope from a DEM in geographic coordinates?

You can, but the results will be wrong unless you apply a z-factor that compensates for the latitude-dependent meridian length. The cleaner approach is to reproject the DEM with the EPSG Reprojector & Coordinate Converter to a local UTM zone first.

Does the calculator use Horn's method or Zevenbergen-Thorne?

Horn's 3x3 method, matching the GDAL default.

What's the difference between slope in degrees and percent rise?

Degrees measure the angle (0 to 90); percent rise is 100 * tan(angle). A 45-degree slope is 100 percent rise; a 26.6-degree slope is 50 percent.

Can I use slope as input to other tools on gis.tools?

Yes β€” feed the slope raster into Raster Reclass Tool to bin into hazard classes or Zonal Statistics to summarise within polygons.

Related Tools on gis.tools

100% client-side processing - your data stays private and never leaves your device