Topo to Raster Batch Process question (Python newbie)

4095
12
07-09-2012 01:00 PM
AndrewMaracini
New Contributor
Hi,

I've searched and researched and sampled but I'm hitting the wall here.

I'm trying to run Topo to Raster on 500+ inputs (topo contours and lake boundaries). I've tried to follow samples and examples in books and I think my workflow is going in the right direction but I'm getting an error, and hoping that someone can find my mistake. I've got all of the files in one directory and I defined my variables with a wildcard which is where I think my problem is but I'm not sure how to define the variable. For example the topo line feature is made up of  519 seperate files that have the naming convention "topo_ras_input_topoSection1","topo_ras_input_topoSection2" The lakes boundary file have a similar naming convention: "topo_ras_input_watersecSection1".

After I defined my variables I then list all of the feature classes and then use a for statement to start iterating through the list, I really should end up with 519 rasters as output but I'm not sure how to specify that either.

My code (I use that term loosely) is attached. Thanks in advance for your help.
Tags (2)
0 Kudos
12 Replies
markdenil
Occasional Contributor III
try it as
arcpy.sa.TopoContour
you will likely need it for
arcpy.sa.Topolake
and
arcpy.sa.TopoToRaster


If you use
from arcpy.sa import *
in your imports, you won't need to specify the module,
but it can be confusing that way
0 Kudos
AndrewMaracini
New Contributor
Thanks for all the help Mark, that did the trick. Now I get to kick the process off and see what happens!

I was able to use the Model Builder iterator with Topo To Raster but without the water boundary parameter, it will be interesting to compare results.

Andy

try it as
arcpy.sa.TopoContour
you will likely need it for
arcpy.sa.Topolake
and
arcpy.sa.TopoToRaster


If you use
from arcpy.sa import *
in your imports, you won't need to specify the module,
but it can be confusing that way
0 Kudos
azizallahizady
New Contributor

Dear Andrew,

Based on your post, "I was able to use the Model Builder iterator with Topo To Raster"; I want to use the Model Builder iterator (For iterator) to run “Topo To Raster” on 200+ inputs. But, when I want to write a dynamic name ("***%value%") in the field part of topo to raster window (attached screenshot) to iterate the computations, it is automatically changed to the first column of dataset. I did the same way for other interpolation methods (IDW & Spline) and they totally worked. Is there any hint about using iterator for “Topo To Raster” tool in the Model Builder? Thank you in advance for your generous help.

ModelB.jpg

0 Kudos