Slope (Spatial Analyst)

Summary

Identifies the slope (gradient, or rate of maximum change in z-value) from each cell of a raster surface.

Learn more about how Slope works

Illustration

Slope illustration
OutRas = Slope(InRas1)

Usage

Syntax

Slope (in_raster, {output_measurement}, {z_factor})
ParameterExplanationData Type
in_raster

The input surface raster.

Raster Layer
output_measurement
(Optional)

Determines the measurement units (degrees or percentages) of the output slope data.

  • DEGREE The inclination of slope will be calculated in degrees.
  • PERCENT_RISE Keyword to output the percent rise, also referred to as the percent slope.
String
z_factor
(Optional)

Number of ground x,y units in one surface z unit.

The z-factor adjusts the units of measure for the z units when they are different from the x,y units of the input surface. The z-values of the input surface are multiplied by the z-factor when calculating the final output surface.

If the x,y units and z units are in the same units of measure, the z-factor is 1. This is the default.

If the x,y units and z units are in different units of measure, the z-factor must be set to the appropriate factor, or the results will be incorrect. For example, if your z units are feet and your x,y units are meters, you would use a z-factor of 0.3048 to convert your z units from feet to meters (1 foot = 0.3048 meter).

Double

Return Value

NameExplanationData Type
out_raster

The output slope raster.

Raster

Code Sample

Slope example 1 (Python window)

This example determines the slope values of the input surface raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outSlope = Slope("elevation", "DEGREE", 0.3043)
outSlope.save("C:/sapyexamples/output/outslope01")
Slope example 2 (stand-alone script)

This example determines the slope values of the input surface raster.

# Name: _Ex_02.py
# Description: Identifies the rate of maximum change 
#    in z-value from each cell.
# 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"
outMeasurement = "DEGREE"
zFactor = 0.3043

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

# Execute Slope
outSlope = Slope(inRaster, outMeasurement, zFactor)

# Save the output 
outSlope.save("C:/sapyexamples/output/outslope02")

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