Aspect

Summary

Identifies the downslope direction of the maximum rate of change in value from each cell to its neighbors.

Discussion

For more information about how this function works, see the Aspect raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

Syntax

Aspect (raster)
ParameterExplanationData Type
raster

The input raster.

Raster
Return Value
Data TypeExplanation
Raster

The output raster.

Code sample

Aspect example 1

This example calculates the aspect of the raster dataset.

from arcpy.ia import *
out_aspect_raster = Aspect("elevation.tif")
out_aspect_raster.save("C:/arcpyExamples/outputs/aspect.tif")
Aspect example 2

This example calculates the aspect of the raster dataset.

# Import the system modules
import arcpy
from arcpy.ia import *

# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"

# Set the local variables
in_raster = "elevation.tif"

# Execute Aspect function
out_aspect_raster = Aspect(in_raster)

# Save the output
out_aspect_raster.save("C:/arcpyExamples/outputs/aspect.tif")