ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Slope

Available with Spatial Analyst license.

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

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

  • Slope is the rate of maximum change in z-value from each cell.

  • The use of a z-factor is essential for correct slope calculations when the surface z units are expressed in units different from the ground x,y units.

  • The range of values in the output depends on the type of measurement units.

    • For degrees, the range of slope values is 0 to 90.
    • For percent rise, the range is 0 to essentially infinity. A flat surface is 0 percent, a 45 degree surface is 100 percent, and as the surface becomes more vertical, the percent rise becomes increasingly larger. See how Slope works for a more detailed explanation of the range of output values with this option.

  • If the center cell in the immediate neighborhood (3 x 3 window) is NoData, the output is NoData.

  • If any neighborhood cells are NoData, they are assigned the value of the center cell; then the slope is computed.

  • When the input raster needs to be resampled, the Bilinear technique will be used. An example of when an input raster may be resampled is when the output coordinate system, extent, or cell size is different from that of the input.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

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.

It will be floating point type.

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

# 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

  • Auto Commit
  • Cell Size
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst or 3D Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst or 3D Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst or 3D Analyst

Related Topics

  • An overview of the Surface toolset
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal