Aspect Transformation

Topographic Analysis · Aspect Tools · geoprocessing tool · by Jeff Jenness
Works at every ArcGIS Pro license level

Summary

Generates one or more transformations of an aspect raster at once: directional reclassifications, in which each cell is assigned a named direction class written to a Class attribute table, and trigonometric transforms, which turn the circular aspect angle into a continuous number that statistics and habitat models can use: northness, eastness, and the deviation from a chosen compass bearing. Built for aspect, it also accepts D-infinity flow-direction rasters, and it requires no Spatial Analyst.

Learn more About Aspect explains why aspect matters to plants and animals, why it is a circle rather than a number line, and the three ways of turning a direction into a number that this tool provides: classes, sines and cosines, and deviation from a bearing. It also describes how the four Aspect Tools fit together.

Why transform aspect at all

Aspect, the compass direction a slope faces, is circular: 359° and 1° are neighbors, not opposites, so the raw angle cannot go into a regression, a mean, or a suitability score as it stands. It becomes more useful for traditional statistical analyses once it is either grouped into a few named classes or converted to a linear number. This tool offers both, and can write several transformations in a single run, each as its own raster in the chosen output location, named from a base name plus a suffix.

Because the tool makes up the names, it never overwrites an existing raster, whatever the geoprocessing overwrite setting. If a name is already taken in the output location, the new raster gets a number added instead: a second run with the base name Grand_Canyon writes Grand_Canyon_NS_2, a third Grand_Canyon_NS_3, and so on, leaving the earlier rasters in place. To replace an earlier result, delete it first, or give the new run a different base name.

Every output arrives in the map already symbolized: each reclassification with a unique-values color scheme keyed to its class names (the eight directions in the colors of the aspect color wheel, Flat in pale tan), and each continuous raster with a diverging blue–white–red stretch. The scheme is also saved as a layer file beside each raster, so it can be reapplied later.

Reclassifications produce integer rasters with a Class attribute table. The classes are numbered 1 upward in the order listed (North = 1, South = 2, and so on; in the eight-direction raster North = 1 through Northwest = 8), the name of each is in the table's Class field, and flat cells, when kept, are the class −1, named Flat:

Trigonometric transforms produce continuous double-precision rasters:

One difference between the two kinds of trigonometric transform matters for statistics. The numeric deviation keeps a constant interval: a change of one degree means the same thing at 5° as at 175°. Sines and cosines do not. Jenness (2012) gives the figures: a one-degree change in direction moves the sine by about 0.00015 near 90° but by about 0.017 near 180°, more than a hundred times as much. That is harmless for a habitat score and for most models, but it matters for a method that assumes its predictors are interval-level, in which case the numeric deviation transform is the safer choice.

Both numeric and trigonometric deviation transforms follow the approach Trimble and Weitzman (1956) introduced for site-productivity research, whose original transform gave its maximum to the northeast because that is where the best upland oaks grew, and which Beers, Dress and Wensel (1966) generalized to any optimum bearing. The target bearing therefore defaults to 45° and can be set to whatever direction is most meaningful for your study. The Normalize Existing HSM page turns a numeric deviation from 45° into a 0–100 habitat factor as its worked example.

Flat cells (aspect −1) have no direction. The trigonometric transforms always write them as NoData, because −1 would be indistinguishable from a real value there. For the reclassifications, the Flat cells option decides whether they get their own Flat class (value −1) or are dropped to NoData.

D-infinity flow direction. A D-infinity flow-direction raster is essentially an aspect raster, the direction of steepest descent, but in the mathematical convention (0 = east, counter-clockwise) rather than compass. Set the input convention to Mathematical and the tool converts to compass before every transformation; it suggests this automatically when it detects a D-infinity raster, and warns when a raster's values fall outside the aspect range, which usually means the input is not aspect at all. A standard D8 flow-direction raster stores flow codes 1 to 128, not degrees, and is not valid input.

A tour of the dialog

The Topographic Analysis Tools gallery open on the ribbon, with the Aspect Transformation button, in the Aspect Tools row, outlined in blue
Where to find it: Aspect Transformation is in the Aspect Tools row of the Topographic Analysis Tools gallery, in the Topographic Analysis group of the Wildlife and Forestry tab.
The Aspect Transformation geoprocessing pane: input aspect raster Aspect; all eight transformations checked (North / South, East / West, North / East / South / West, 8 directions, Northness, Eastness, trigonometric deviation from a bearing, numeric deviation from a bearing); output location Test_Roughness.gdb; output base name Grand_Canyon; target bearing 45; input aspect convention Compass (0 = north, clockwise); flat cells: reclassifications keep a Flat class (trig transforms are NoData at flat cells)
All eight transformations of an aspect raster from the Grand Canyon in one run, written to a file geodatabase under the base name Grand_Canyon. The target bearing stays at its default, 45° (northeast), and flat cells keep their own class in the reclassifications.
Side-by-side maps of the same area. Left: Grand_Canyon_NS, with North in green and South in red. Right: Grand_Canyon_EW, with East in green and West in red. Both legends also list a gray Flat class.
The two-class reclassifications, North / South (left) and East / West (right). Each raster is named from the base name plus a suffix, here _NS and _EW, and its class names come from the Class field of its attribute table.
Side-by-side maps of the same area. Left: Grand_Canyon_NESW, with North, East, South and West classes in orange, green, blue and red. Right: Grand_Canyon_8Dir, with North, Northeast, East, Southeast, South, Southwest, West and Northwest classes in eight colors. Both legends also list a gray Flat class.
The four-direction (left) and eight-direction (right) reclassifications of the same area.
Side-by-side grayscale maps of the same area. Left: Grand_Canyon_Northness, from -1 (black) to 1 (white). Right: Grand_Canyon_Eastness, from -1 (black) to 1 (white).
Northness (left) and eastness (right), each running from −1 to 1. North-facing slopes are white in the northness raster and south-facing slopes black; east-facing slopes are white in the eastness raster and west-facing slopes black.
Side-by-side grayscale maps of the same area. Left: Grand_Canyon_TrigDev45, from -1 (black) to 1 (white). Right: Grand_Canyon_DevFrom45, from about 0 (black) to 180 (white). The two images look like negatives of each other.
The two deviations from a bearing of 45°, with different ranges and opposite senses. The trigonometric deviation (left) runs from 1 on slopes facing northeast (white) to −1 on slopes facing southwest (black); the numeric deviation (right) runs from 0° on slopes facing northeast (black) to 180° on slopes facing southwest (white). That is why the two images look like negatives of each other.
The Aspect Transformation run report, Messages tab: the ImportToolbox scripting hint; a Created line for each of the eight output rasters in Test_Roughness.gdb, from Grand_Canyon_NS through Grand_Canyon_DevFrom45; a statistics-and-histogram line after each continuous raster; Aspect Transformation complete: created 8 raster(s); elapsed time 52.39 seconds
The run report: the full path of each raster as it is written, and the elapsed time, here 52 seconds for all eight. The four continuous rasters carry their statistics and histogram, so they display without a statistics scan.

The tool holds the whole raster in memory at once, so the memory it needs grows with the number of cells. On most rasters that is no concern. On a very large one the tool may need more memory than your computer has free, and then one of two things happens: Windows starts using the disk as overflow memory and the tool slows to a crawl, or the tool stops with an out-of-memory error. There is no fixed limit; it depends on how much memory your computer has free. If a raster is too large, clip it to the area you need first.

ModelBuilder

A ModelBuilder diagram: the Aspect raster and the Test_Roughness.gdb workspace feed Aspect Transformation, which produces an Output rasters list and eight single outputs, Grand_Canyon_NS_3 through Grand_Canyon_DevFrom45_3
Aspect Transformation in a model, with all eight transformations chosen: the Output rasters list at the top, and below it one output for each transformation. The names end in _3 because rasters from two earlier runs were already in the geodatabase; the tool never overwrites an existing raster, but adds a number to the new name instead.

Every raster the run writes comes out of the tool twice in a model. Output rasters holds all of them as one list, which suits a tool that takes several rasters at once, such as Composite Bands or Cell Statistics. Each transformation also has an output of its own, from North / South raster through Numeric deviation raster, so a model can connect a single transformation, such as the northness raster, directly to the next tool. The outputs for transformations that were not chosen stay empty.

Parameters

LabelExplanationData type
Input aspect raster (single band)Required · in_raster A single-band aspect raster in degrees, 0–360 clockwise from north, with −1 for flat cells. A D-infinity flow-direction raster is also valid; set the input convention to Mathematical for it. Raster Layer
TransformationsRequired · transformations One or more transformations to generate, each written as its own raster: the four reclassifications and the four trigonometric transforms described above. In a script the option strings are exactly Reclassify: North / South, Reclassify: East / West, Reclassify: North / East / South / West, Reclassify: 8 directions (N / NE / E / SE / S / SW / W / NW), Northness (cosine of aspect; 1 = north, -1 = south), Eastness (sine of aspect; 1 = east, -1 = west), Trigonometric deviation from a bearing (1 = toward, -1 = away) and Numeric deviation from a bearing (degrees, 0 - 180). The dialog remembers the last selection, the target bearing and the flat-cells choice. Multiple Value
Output location (folder or geodatabase)Required · out_workspace The folder or geodatabase the output rasters are written to. Defaults to the input raster's workspace. Workspace
Output base nameOptional · base_name The base name for the outputs; each transformation adds a suffix (_NS, _8Dir, _Northness, _TrigDev45, and so on). Defaults to the input raster's name. Names are made valid for the output location, and an existing raster is never overwritten: if a name is taken, a number is added to the new one (_NS_2, _NS_3, and so on). String
Target bearing (deg, for the deviation transforms)Optional · target_bearing The reference bearing, 0–360°, for the two deviation transforms: the direction that scores 1 (trigonometric) or 0 (numeric). Default 45°, northeast, the optimum in Trimble and Weitzman's oak study. Used only when a deviation transform is selected. Double
Input aspect conventionRequired · input_convention Compass (0 = north, clockwise) for an ordinary aspect raster; Mathematical (0 = east, counter-clockwise) for a D-infinity flow-direction raster. String
Flat cellsRequired · flat_handling For the reclassifications: keep flat cells as their own Flat class (value −1) or drop them to NoData. The trigonometric transforms always write flat cells as NoData. The two options are Reclassifications keep a Flat class (trig transforms are NoData at flat cells) and All transforms: flat cells -> NoData; the default is the second. String
Output rastersDerived · out_rasters Every raster written, as one list, for a tool that takes several rasters at once. Raster Dataset
North / South raster, East / West raster, North / East / South / West raster, 8-direction raster, Northness raster, Eastness raster, Trigonometric deviation raster, Numeric deviation rasterDerived · out_ns, out_ew, out_nesw, out_8dir, out_northness, out_eastness, out_trigdev, out_numdev One output per transformation, holding that transformation's raster when it was chosen and empty otherwise, so a model can connect a single transformation to the next tool. Raster Dataset

This tool honors no geoprocessing environments; the raster is processed in its own coordinate system and never projected.

Python

import arcpy
arcpy.ImportToolbox(r"C:\path\to\JennessEnterprisesTools.pyt")  # your install path
result = arcpy.jenness.AspectTransformation(
    in_raster=r"D:\tutorial.gdb\Aspect",
    transformations=["Northness (cosine of aspect; 1 = north, -1 = south)",
                     "Numeric deviation from a bearing (degrees, 0 - 180)"],
    out_workspace=r"D:\tutorial.gdb",
    base_name="Black_Bear_Aspect",
    target_bearing=45,
    input_convention="Compass (0 = north, clockwise)",
    flat_handling="All transforms: flat cells -> NoData")

northness = result.getOutput(4)                # the northness raster
deviation = result.getOutput(7)                # the numeric deviation
every_raster = result.getOutput(8).split(";")  # all rasters written

The tool returns a Result object, and result.getOutput(n) gives the path of any of its outputs. These are the actual paths written, including any number the tool added to keep from overwriting an earlier raster, so they are safer than rebuilding the names in the script. An output for a transformation that was not chosen returns an empty string. Wrap a path in arcpy.Raster() to use it in map algebra.

IndexOutput
0North / South raster
1East / West raster
2North / East / South / West raster
38-direction raster
4Northness raster
5Eastness raster
6Trigonometric deviation raster
7Numeric deviation raster
8Output rasters: every raster written, as one string separated by semicolons

Recommended citation

Jenness, J. 2026. Aspect Transformation. Wildlife and Forestry Tools add-in for ArcGIS Pro, v. 1.99 (September 2026). Jenness Enterprises. Available at: https://github.com/JeffJenness/Wildlife_Tools.

Credits and references

By Jeff Jenness, Jenness Enterprises (www.jennessent.com).

Licensing information

Works at every ArcGIS Pro license level (Basic, Standard, Advanced). No extension licenses are required.