1 | # --------------------------------------------------------------------------- |
---|
2 | # txt2fc_field.py |
---|
3 | # Created on: Thu Nov 27 2008 01:48:26 PM |
---|
4 | # (generated by ArcGIS/ModelBuilder) |
---|
5 | # --------------------------------------------------------------------------- |
---|
6 | |
---|
7 | # Import system modules |
---|
8 | import sys, string, os, arcgisscripting, glob, os.path |
---|
9 | |
---|
10 | # Create the Geoprocessor object |
---|
11 | gp = arcgisscripting.create() |
---|
12 | |
---|
13 | # Load required toolboxes... |
---|
14 | gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx") |
---|
15 | gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") |
---|
16 | gp.overwriteoutput = 1 |
---|
17 | |
---|
18 | scenario_dir="\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\carnarvon_tsunami_scenario\\" |
---|
19 | output_dir = "anuga\\outputs\\" |
---|
20 | |
---|
21 | time_dir1 = '20081202_084220_run_final_1_27283_alpha0.1_kvanputt' |
---|
22 | time_dir2 = '20081202_084202_run_final_1_27255_alpha0.1_kvanputt' |
---|
23 | time_dir3 = '20081202_084132_run_final_1_68693_alpha0.1_kvanputt' |
---|
24 | time_dir4 = '20081202_084025_run_final_0_68693_alpha0.1_kvanputt' |
---|
25 | time_dir5 = '20081202_083932_run_final_0_27255_alpha0.1_kvanputt' |
---|
26 | time_dir6 = '20081201_103449_run_final_0_27283_alpha0.1_kvanputt' |
---|
27 | |
---|
28 | time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6] |
---|
29 | |
---|
30 | for time_dir in time_dirs: |
---|
31 | |
---|
32 | # Local variables... |
---|
33 | folder = scenario_dir + output_dir + time_dir + '\\' |
---|
34 | input_dir_name = folder+'carnarvon_runup.csv' |
---|
35 | raster_gdb = folder + "raster.gdb" |
---|
36 | layer = 'layer' |
---|
37 | |
---|
38 | ## print 'Process: Create File GDB' |
---|
39 | ## gp.CreateFileGDB_management(folder, "raster") |
---|
40 | |
---|
41 | print 'Process: Make XY Event Layer' |
---|
42 | gp.MakeXYEventLayer_management(input_dir_name, "x", "y", layer, "PROJCS['GDA_1994_MGA_Zone_49',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994'" |
---|
43 | ",SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0]" |
---|
44 | ",UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator']" |
---|
45 | ",PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0]" |
---|
46 | ",PARAMETER['Central_Meridian',111.0],PARAMETER['Scale_Factor',0.9996]" |
---|
47 | ",PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]") |
---|
48 | |
---|
49 | print 'Process: Feature Class to Feature Class' |
---|
50 | gp.FeatureClassToFeatureClass_conversion(layer, raster_gdb, "carnarvon_runup", "", "area area true true false 255 Text 0 0 ,First,#,carnarvon_runup.csv_Features,area,-1,-1;q q true true false 8 Double 0 0 ,First,#,carnarvon_runup.csv_Features,q,-1,-1;x x true true false 8 Double 0 0 ,First,#,carnarvon_runup.csv_Features,x,-1,-1;y y true true false 8 Double 0 0 ,First,#,carnarvon_runup.csv_Features,y,-1,-1", "") |
---|
51 | |
---|
52 | |
---|
53 | |
---|