Jump to content

 
Photo

Run a model builder

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Robert2009

Robert2009

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 122 posts
  • Gender:Male
  • Location:Las Cruces, NM
  • United States

Happy New Year to Everyone !

I am working on building a model in a Model Builder. What I am trying to do here is to run each DEM to create a slope for each quad. Then I reclassify each slope to slope breaks then make it a tempoary layer to a scratch workspace. Then resample the reclassify to Bilinear Interpolation to make the layer to a permanment layer in another workspace.

I have include the attachment that someone out there can help me ?

Reason for this is that I have to run about 30 times. It will save my time so.... I appreciate it

Attached File  Model_Builder.jpg   57.77KB   95 downloads

Thanks,
Robert Pollock
MLRA 42
Las Cruces Soil Survey Office
Las Cruces, NM 88011
Videophone - 1-866-642-3890 (USA/Canada only)

#2
Ninomax

Ninomax

    Contributor

  • Validated Member
  • PipPip
  • 37 posts
  • Vietnam

Provided that you have all DEM files in a folder, if you know Python scripting, you could export your model to python and put the exported codes in a for - loop like this:
(this works on ArcGIS 9.3 or 9.3.1)

[codebox]# --------------------------------------------------------------------------- # modelPython.py # Created on: Sat Jan 09 2010 11:29:49 PM # (generated by ArcGIS/ModelBuilder) # --------------------------------------------------------------------------- # Import system modules import sys, string, os, arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() # Check out any necessary licenses gp.CheckOutExtension("spatial") gp.Workspace = "DEMfolder" # Load required toolboxes... gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx") gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") DEMfiles = gp.ListRaster("", "GRID") for Demfile in DEMfiles: # Local variables... Input_raster = Demfile ReclassOutput = Input_raster +"Rec" MakeRLOutPut = Input_raster +"MakeRL" FinalOutput = Input_raster + "Final" # Process: Reclassify... gp.Reclassify_sa(Input_raster, "", "", ReclassOutput, "DATA") # Process: Make Raster Layer... gp.MakeRasterLayer_management(ReclassOutput, MakeRLOutPut, "", "DEFAULT", "")

# Process: Resample...
gp.Resample_management(MakeRLOutPut, FinalOutput, "", "NEAREST")
[/codebox]

Hope this helps! :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->