spencermeyer

Call from env.workspace and another directory in same function

Discussion created by spencermeyer on Sep 27, 2012
Latest reply on Sep 28, 2012 by spencermeyer
I am using a python script to run sa.combine on several rasters. Most of the rasters are in one GDB, which I've set as my workspace. That works great.

Now I need to pull in another raster from a different directory.

I've tried the following:
arcpy.env.workspace = "C:\\GIS\\LPRW.gdb"

modelrasters = "AvailLC;RecAccLC;CultHist;ScenicQ;BlckSzLC;CohsnLC;HabtatLC;DrWatLC"

studyareastring = "C:\\GIS\\OtherGDB.gdb\\LPRW_SA"

outCombine = sa.Combine(studyareastring + ";" + modelrasters)


However, the result does not include my first raster. I can't just put the studyarea raster into the other GDB because that same raster is used for many different iterations of this model on different workspace GDBs.  Conceptually I want to do something like:
outCombine = sa.Combine(..\\OtherGDB.gdb\\LPRW_SA + ";" + modelrasters)
but I know I know escaping up a directory isn't allowed in arcpy.

thanks!

Outcomes