| |
# ---------------------------------------------------------------------------
# test.py
# Created on: Tue Nov 03 2009 05:17:13 PM
# (generated by ArcGIS/ModelBuilder)
# ---------------------------------------------------------------------------
# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Set the necessary product code
gp.SetProduct("ArcInfo")
# Check out any necessary licenses
gp.CheckOutExtension("spatial")
gp.CheckOutExtension("3D")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Statistics Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/3D Analyst Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")
# Local variables...
v3_9_shp = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\vector\\netl\\slopes\\demIntersect\\3_9\\3_9.shp"
extract = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\extract"
Slope__3_ = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\slope"
dem = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\raster\\jimDems\\dems\\ws74\\dem"
Filter__3_ = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\filter"
Agg = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\agg"
Reclass = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\reclass"
Polygon_shp = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\polygon.shp"
PolygonCalc_shp = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\PolygonCalc.shp"
PolygonLayer = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\PolygonLayer"
Eliminate_shp = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\Eliminate.shp"
Eliminate_Intersect_shp = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\Eliminate_Intersect.shp"
travel_route_join_SP_shp = "F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\vector\\anf\\travel_route\\mod\\travel_route_join_SP.shp"
PolygonLayer__2_ = "PolygonLayer"
PolygonLayer__3_ = "PolygonLayer"
# Process: Extract by Mask...
gp.ExtractByMask_sa(dem, v3_9_shp, extract)
# Process: Slope...
gp.Slope_3d(extract, Slope__3_, "DEGREE", "1")
# Process: Filter...
gp.Filter_sa(Slope__3_, Filter__3_, "LOW", "DATA")
# Process: Aggregate...
gp.Aggregate_sa(Filter__3_, Agg, "3", "MEAN", "EXPAND", "DATA")
# Process: Reclassify...
gp.Reclassify_sa(Agg, "VALUE", "0 5 5;5 10 10;10 15 15;15 25 25;25 50 50;50 75 75;75 100 100;100 300 500", Reclass, "DATA")
# Process: Raster to Polygon...
gp.RasterToPolygon_conversion(Reclass, Polygon_shp, "SIMPLIFY", "VALUE")
# Process: Calculate Areas...
gp.CalculateAreas_stats(Polygon_shp, PolygonCalc_shp)
# Process: Make Feature Layer...
gp.MakeFeatureLayer_management(PolygonCalc_shp, PolygonLayer, "\"F_AREA\" > 1014", "", "")
# Process: Make Feature Layer (2)...
gp.MakeFeatureLayer_management(PolygonLayer, PolygonLayer__3_, "", "", "")
# Process: Select Layer By Attribute...
gp.SelectLayerByAttribute_management(PolygonLayer__3_, "NEW_SELECTION", "\"F_AREA\" < 1014")
# Process: Eliminate...
gp.Eliminate_management(PolygonLayer__2_, Eliminate_shp, "LENGTH")
# Process: Intersect...
gp.Intersect_analysis("F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\test\\modelTry\\Eliminate.shp #;F:\\temp\\chris\\ord\\allegheny_forest\\new\\data\\vector\\anf\\travel_route\\mod\\travel_route_join_SP.shp #", Eliminate_Intersect_shp, "ALL", "", "INPUT")
|