source: anuga_work/production/new_south_wales/batemans_bay/Arc_Inundation_polygon.py @ 7369

Last change on this file since 7369 was 7096, checked in by kristy, 15 years ago
File size: 3.0 KB
Line 
1# ---------------------------------------------------------------------------
2# Inundation_line.py
3# Created on: Tue May 12 2009 01:50:45 PM
4#   (generated by ArcGIS/ModelBuilder)
5# Usage: Inundation_line <Bun_depth_M_E> <Bus_depth_M_E> <bunbury_1km> <busselton_1km>
6# ---------------------------------------------------------------------------
7
8# Import system modules
9import sys, string, os, arcgisscripting, glob
10
11# Create the Geoprocessor object
12gp = arcgisscripting.create()
13gp.overwriteoutput = 1
14
15# Set the necessary product code
16gp.SetProduct("ArcInfo")
17
18# Check out any necessary licenses
19gp.CheckOutExtension("spatial")
20
21# Load required toolboxes...
22gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
23gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
24gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
25gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")
26
27# Script arguments...
28model = 'hobart'
29scenario_folder ="\\\\nas2\\gemd\\georisk_models\\inundation\\data\\tasmania\\" + model + "_tsunami_scenario_2009\\"
30output_folder = "anuga\\outputs\\"
31
32time_dir1 = '20090505_150430_run_final_0.8_58292_None_kvanputt'
33time_dir2 = '20090505_150517_run_final_0_58292_None_kvanputt'
34time_dir3 = '20090505_150711_run_final_0_58280_None_kvanputt'
35time_dir4 = '20090505_150805_run_final_0.8_58280_None_kvanputt'
36time_dir5 = '20090505_151322_run_final_0.8_64477_None_kvanputt'
37time_dir6 = '20090505_151447_run_final_0_64477_None_kvanputt'
38
39time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
40
41for time_dir in time_dirs:
42    print "time_dir = ",time_dir
43    raster = output_folder + time_dir + "\\raster.gdb\\"
44   
45    # Local variables...
46    locations = ['Hobart', 'NW', 'South']
47    # polygon clip
48    extent = scenario_folder + "ArcGIS\\data.gdb\\PriorityAreasHobart"
49    # name of rasters
50    for location in locations:
51        depth = raster + location +'_depth_M_E'
52        depth_raster = depth
53
54        # Local variables...
55        Output_raster = raster +"Temp_raster_"+ location
56        Output_polygon_features = raster +"Temp_polygon_"+ location
57        Output_Feature_Class = raster +"Temp_line_"+ location
58        Reclassification = "0 0.05 NODATA;0.05 4.5840001106262207 1"
59        Inundation = raster + "Inundation_" + location + "_polygon"
60        Inundation_line = raster + "Inundation_line"
61         
62        print 'Process: Reclassify'
63        gp.Reclassify_sa(depth, "Value", Reclassification, Output_raster, "DATA")
64       
65        print 'Process: Raster to Polygon'
66        gp.RasterToPolygon_conversion(Output_raster, Output_polygon_features, "SIMPLIFY", "VALUE")
67
68        print 'Process: Clip'
69        gp.Clip_analysis(Output_polygon_features, extent, Inundation, "")
70
71        print 'Process: Delete'
72        gp.Delete_management(Output_raster, "RasterDataset")
73        gp.Delete_management(Output_polygon_features, "FeatureClass")
74
Note: See TracBrowser for help on using the repository browser.