0

I'm trying to make a slope raster from a lot of DEM`s.

The DEM rasters are in this file Geodatabase C:\Bachelorarbeit\Daten\GIs\Originale\dtk25_dgm1.gdb The slope raster should be saved in this file Geodatabase C:\Users\Hans im Glück\Documents\ArcGIS\Default.gdb

Is it possible to use spaces in my pathname?

I have ArcGIS 10.3 and found this basic script on ESRI's website:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outSlope = Slope("elevation", "DEGREE", 1)
outSlope.save("C:/sapyexamples/output/outslope01")

How to I execute this script on multiple DEM's contained within a folder?

Hornbydd
44.9k5 gold badges43 silver badges84 bronze badges
asked Jul 5, 2016 at 15:03
1
  • Yes, you can have spaces in your pathnames. To get a list of rasters in your GDB, you'll want to use ListRasters with a for loop. Commented Jul 5, 2016 at 16:01

1 Answer 1

1

As your DEM data is in a file geodatabase then you will note 3 things about the file names:

  • They do not start with a number
  • They do not have spaces in their names
  • They are unique names

As @Paul says in the comment you can create a list and loop through this. You could just use the name of the DEM for the output name of your slope raster, that would be simplest but it may be prudent to change it in some way to indicate it is a slope raster. You could easily do that at the point when you save your raster.

answered Jul 6, 2016 at 9:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.