480 likes | 605 Views
Geog 376 Intermediate GIS Programming. Spring 2010 Instructor: Nathan Jennings. Final project. Fui Fang Thong. Introduction.
E N D
Geog 376 Intermediate GIS Programming Spring 2010 Instructor: Nathan Jennings Final project Fui Fang Thong
Introduction • The hydrologists utilize precipitation map and average watershed precipitation map to determine a suitable site for any proposed power plant site. • Preparations of precipitation maps on different groundwater basins involve the same geoprocessing steps. • Hence, batch geoprocess on the related shapefiles will speed up the process in maps preparation.
Program Overview • The watershed boundary was determined by intersecting all the individual groundwater basin shapefiles with 12 digit watershed boundary rather than ArcHydro tool. • In order to achieve the goals, California groundwater shapefile with a total of 595 rows of records (Figure 1) was clipped into 595 individual shapefiles with single row (Figure 2). • The clipped 595 shapefiles were used to intersect with 12 digit California watershed shapefile (Figure 3). The intersected shapefiles (Figure 4) were exported as 595 individual sub water basin shapefiles (Figure 5). • The sub water basin shapefiles were used to spatial join with California precipitation shapefile (Figure 6) for calculation of average precipitation by basin (Figure 7). • The sub water basin shapefiles were used to clip with California precipitation shapefile for displaying the amount of rainfall with isomer (Figure 8). • A generalized street features (Figure 9) are required for the purpose of precipitation map since they are used to show a general spatial location of any basin.
Program Overview Figure 1: California groundwater
Program Overview Figure 2: Sub groundwater shapefile
Program Overview Figure 3: California watershed
Program Overview Figure 4: Intersection between sub groundwater shapefile with California watershed shapefile
Program Overview Figure 5: Sub water basin shapefile
Program Overview Figure 6: California precipitation
Program Overview Figure 7: Average precipitation shapefile based on sub water basin
Program Overview Figure 8: Precipitation with isomer within a sub water basin
Program Overview Figure 9: California highway shapefile (left) and California major highway shapefile (right)
TFF1_ManipulateTable.py Code # 1
TFF1_ManipulateTable.py Code # 1 Add new field “GWNAME” on cgw1 as text and FID Calculate new field as concatenation of GWBASIN and FID Calculate field with “Replace” function
TFF1_ManipulateTable.py Code # 1 Deleting fields
TFF1_ManipulateTable.py Code # 1
TFF1_ManipulateTable.py Debug # 1
TFF2_BatchSplit.py Code # 2
TFF2_BatchSplit.py Code # 2
TFF2_BatchSplit.py Code # 2 “searchcursor” and “next” methods to access all the records in groundwater table GetValue method to get the value for the “GWNAME” field “MakeFeatureLayer” to create new feature layer
TFF2_BatchSplit.py Code # 2 “CopyFeatures” method to export feature layer into shapefile Note: “Except” code is same as slide number 5.
TFF2_BatchSplit.py Code # 2 Time function
TFF2_BatchSplit.py Debug # 2
TFF2_BatchSplit.py Debug # 2
TFF3_BatchIntersect.py Code # 3
TFF3_BatchIntersect.py Code # 3 “ListFeatureClasses” method to list all the shapefiles in current workspace which are polygon and begin with the characters “cgw”
TFF3_BatchIntersect.py Code # 3 Discard first 4 and last 4 characters of shapefile name
TFF3_BatchIntersect.py Code # 3 “SelectLayerByLocation” with “INTERSECT” option Note: “Except” code is same as slide number 5 and “Time” function calculation is same as slide number 11.
TFF3_BatchIntersect.py Debug # 3
TFF3_BatchIntersect.py Debug # 3
TFF4_BatchSpatialJoin.py Code # 4
TFF4_BatchSpatialJoin.py Code # 4 Declare join feature “ListFeatureClasses” method Declare target feature
TFF4_BatchSpatialJoin.py Code # 4 Create fieldmappings object
TFF4_BatchSpatialJoin.py Code # 4
TFF4_BatchSpatialJoin.py Code # 4 Note: “Except” code is same as slide number 5 and “Time” function calculation is same as slide number 11.
TFF4_BatchSpatialJoin.py Debug # 4
TFF4_BatchSpatialJoin.py Debug # 4
TFF5_BatchClip.py Code # 5
TFF5_BatchClip.py Code # 5
TFF5_BatchClip.py Code # 5 “Clip” method to extract shapefile
TFF5_BatchClip.py Code # 5 Note: “Except” code is same as slide number 5 and “Time” function calculation is same as slide number 11.
TFF5_BatchClip.py Debug # 5
TFF5_BatchClip.py Debug # 5
TTFF6_ClassifyHwy.py Code # 6
TTFF6_ClassifyHwy.py Code # 6 “GetCount” method to count selected features
TTFF6_ClassifyHwy.py Code # 6
TTFF6_ClassifyHwy.py Code # 6 Note: “Except” code is same as slide number 5 and “Time” function calculation is same as slide number 11.
TTFF6_ClassifyHwy.py Debug # 6