Aspect (Spatial Analyst)

Summary

Derives aspect from a raster surface. The aspect identifies the downslope direction of the maximum rate of change in value from each cell to its neighbors.

Aspect can be thought of as the slope direction. The values of the output raster will be the compass direction of the aspect.

Learn more about how Aspect works

Illustration

Aspect illustration
OutRas = Aspect(InRas1)

Usage

Syntax

Aspect (in_raster)
ParameterExplanationData Type
in_raster

The input surface raster.

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output aspect raster.

Raster

Code Sample

Aspect example 1 (Python window)

This example creates an aspect raster from an input surface raster.

import arcpy
from arcpy import env  
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outAspect = Aspect("elevation")
outAspect.save("C:/sapyexamples/output/outaspect01.img")
Aspect example 2 (stand-alone script)

This example creates an aspect raster from an input surface raster.

# Name: Aspect_Ex_02.py
# Description: Derives aspect from a raster surface.
# Requirements: Spatial Analyst Extension
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inRaster = "elevation"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute Aspect
outAspect = Aspect(inRaster)

# Save the output 
outAspect.save("C:/sapyexamples/output/outaspect02")

Environments

Related Topics

Licensing Information

ArcView: Requires Spatial Analyst or 3D Analyst
ArcEditor: Requires Spatial Analyst or 3D Analyst
ArcInfo: Requires Spatial Analyst or 3D Analyst

6/29/2011