Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Surface (Spatial Analyst)

Slope

Release 9.3
Last modified September 7, 2011
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Surface (Spatial Analyst)"


Related Topics

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

Learn more about how Slope works


Illustration

Slope illustration

Map Algebra:
OutRas = Slope(InRas1)

Command Line:
Slope_sa InRas1 OutRas

Usage tips

Command line syntax
An overview of the Command Line window
Slope_sa <in_raster> <out_raster> {DEGREE | PERCENT_RISE} {z_factor}

Parameter Explanation Data Type
<in_raster>

Input raster.

Composite Geodataset
<out_raster>

The raster to be created.

Raster Dataset
{DEGREE | PERCENT_RISE}

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}

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


Command line example

Slope_sa C:/data/dem C:/data/slope PERCENT_RISE

Scripting syntax
About getting started with writing geoprocessing scripts
Slope_sa (in_raster, out_raster, output_measurement, z_factor)

Parameter Explanation Data Type
in_raster (Required)

Input raster.

Composite Geodataset
out_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, degree, 2)

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)

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.