Aspect

Derives aspect from a raster surface. 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

Usage tips

Command line and Scripting

Map Algebra

ArcObjects

Syntax

Aspect_sa (in_raster, out_raster)
Parameter Explanation Datatype
Input raster (Required)

Input raster.

Composite Geodataset
Output raster (Required)

The raster to be created.

Raster Dataset
Data types for geoprocessing tool parameters

Script Example

# Aspect_sample.py
# Description:
#   Derives aspect from a raster surface.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InRaster = "C:/data/dem"
    OutRaster = "C:/data/aspect"

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

    # Process: Aspect
    gp.Aspect_sa(InRaster, OutRaster)

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax

Aspect(<grid>)

Parameter Explanation
<grid> Any valid combination of rasters, numbers, operators, and functions that produces an output raster.

Map Algebra example

aspect(ingrid)					
aspect(ingrid) * 5					
aspect(ingrid1 + ingrid2)

ArcObjects syntax

ISurfaceOp::Aspect (geoDataset As IGeoDataset) As IGeoDataset

Parameter Explanation
geoDataset An input Raster, RasterDataset, RasterBand, or RasterDescriptor.

ArcObjects example

' Create the RasterSurfaceOp object
Dim pSurfaceOp As ISurfaceOp
Set pSurfaceOp = New RasterSurfaceOp

' Declare the input raster object
Dim pInputDataset As IGeoDataset

' Calls function to open a raster dataset from disk
Set pInputDataset = OpenRasterDataset ("D:\SpatialData", "inputraster")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pSurfaceOp.Aspect (pInputDataset)

See Also

  • Contour
  • Hillshade
  • Slope
  • Using the ArcGIS Spatial Analyst toolbar to calculate aspect
  • An overview of the Surface tools