Slope

Identifies the rate of maximum change in z-value from each cell.

Learn more about how Slope works


Illustration

Slope illustration

Usage tips

Command line and Scripting

Map Algebra

ArcObjects

Syntax

Slope_sa (in_raster, out_raster, output_measurement, z_factor)
Parameter Explanation Datatype
Input raster (Required)

Input raster.

Composite Geodataset
Output raster (Required)

The raster to be created.

Raster Dataset
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)

The 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
Data types for geoprocessing tool parameters

Script Example

# Slope_sample.py
# Description: 
#   Derives slope 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/slope"
    InMeasurementType = "PERCENT_RISE"

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

    # Process: Slope
    gp.Slope_sa(InRaster, OutRaster, InMeasurementType)

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

Map Algebra syntax

Slope(<grid>, {DEGREE | PERCENTRISE})

Slope(<grid>, <z_factor>, {DEGREE | PERCENTRISE})

Parameter Explanation
<grid> Any valid combination of rasters, numbers, operators, and functions that produces an output raster.
{DEGREE | PERCENTRISE} Keywords specifying the units in which the value of slope will be expressed.
  • DEGREE — The inclination of slope will be calculated in degrees.
  • PERCENTRISE — Keyword to output the percent rise, also referred to as the percent slope.
<z_factor> The 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 meters).

Map Algebra example

slope(ingrid)
slope(ingrid, percentrise)
slope(ingrid, .328)
slope(ingrid, 2, degree)

ArcObjects syntax

ISurfaceOp::Slope (geoDataset As IGeoDataset, slopeType As esriGeoAnalysisSlopeEnum, [zFactor As Variant]) As IGeoDataset

Parameter Explanation
geoDataset An input Raster, RasterDataset, RasterBand, or RasterDescriptor.
slopeType
  • EsriGeoAnalysisSlopeEnum — Specifies the units in which the value of slope will be expressed.
  • EsriGeoAnalysisSlopeDegree — Indicates to calculate the inclination of slope in degrees.
  • EsriGeoAnalysisSlopePercentrise — Indicates to output the percent rise, also referred to as the percent slope.
zFactor The 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 meters).

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", "inputdataset")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pSurfaceOp.Slope (pInputDataset, esriGeoAnalysisSlopeDegrees)

See Also

  • Contour
  • Hillshade
  • Viewshed
  • Using the ArcGIS Spatial Analyst toolbar to calculate slope
  • Applying a z-factor
  • An overview of the Surface tools