Geoprocessing: Difference between revisions
From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs) m Geoprocessing scripts moved to Geoprocessing |
Brian Wilson (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
[[Model Builder]] | |||
Online help: http://webhelp.esri.com/arcgisdesktop/9.1/index.cfm | Online help: http://webhelp.esri.com/arcgisdesktop/9.1/index.cfm | ||
Revision as of 23:20, 11 May 2006
Online help: http://webhelp.esri.com/arcgisdesktop/9.1/index.cfm
The script so far:
# --------------------------------------------------------------------------- # StructId.py # Created on: Tue Feb 14 2006 05:06:58 PM # (generated by ArcGIS/ModelBuilder) # --------------------------------------------------------------------------- # Import system modules import sys, string, os, win32com.client # Create the Geoprocessor object gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") # gp.workspace = "H:/BrianWilson/Workspace/Collections/Collections.mdb/Collections" out_workspace = "C:/Temp/NewShapefiles" # Load required toolboxes... #gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") # Process: Calculate Field... # the expressions here can only be very simple. # You can use variables in [square brackets], you can use constants, and you can use # simple operators like + - / * and (for strings) & # manhole_shp = "C:\\TEMP\\NewShapefiles\\manhole.shp" #gp.CalculateField_management(manhole_shp, "STRUCT_ID", "[STRUCT_TYP]&\"-\"& [MH_LABEL]") # Export all the feature classes from our geodatabase to individual shapefiles fcs=gp.ListFeatureClasses() fcs.reset() fc=fcs.Next() while fc: output_shapefile = out_workspace + '/' + fc gp.AddMessage("Working on " + fc + "...") gp.FeatureClassToShapefile_conversion(fc, out_workspace) fc = fcs.next() # Rename the new shapefiles to their correct GISMO names # Calculate the missing field values # Delete the fields that don't belong in GISMO output