Select to view content in your preferred language

Batch Process Slope Tool

1137
1
06-06-2011 01:20 PM
DerrickFrese
Emerging Contributor
I have a large collection of DEM's which I want to run through Arc's slope tool to create a slope data layer.  Anybody out there done this before?
Tags (2)
0 Kudos
1 Reply
JakeSkinner
Esri Esteemed Contributor
Here is an example on how to run the Slope tool from Spatial Analyst on a collection of individual DEMs:

import arcpy
from arcpy import env
from arcpy import sa
from arcpy.sa import *

arcpy.CheckOutExtension("Spatial")

env.workspace = r"C:\DATA\DEM"

lstRasters = arcpy.ListRasters("*")

for raster in lstRasters:  
    outSlope = Slope(raster, "DEGREE", .3048)
    outSlope.save(r"C:\DATA\DEM" + "\\" + str(raster) + "_slope.tif")
0 Kudos