Hi, I've been working on a Python script to convert a table (from MS Access .mdb) to a shapefile. The code below works well for my smaller tables (about 2,000 records with 50 fields; runs in 51 seconds), but takes far too long for larger ones (about 75,000 records with 50 fields; still running after 1 hour 45 minutes...). The idea is to programmatically replicate the ArcMap actions of "Add XY Data" and "Export Data to Shapefile", so I'm using gp.MakeXYEventLayer_management and gp.CopyFeatures_management. It takes much more time via Python than the actions would take in ArcMap, which leads me to wonder if I'm missing something. Any suggestions on how to make this work faster?
# Import system modules
print "Importing system modules..."
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Load required toolboxes...
print "Loading toolboxes..."
gp.AddToolbox("C:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
# Setting OverWriteOutput to True allows geoprocessing tools to overwrite
# the output if it already exists.
gp.OverWriteOutput = 1
XY_Table = ""
#-------------Groundwater Part ----------------------
GWLayer = "'Groundwater$'_Layer3"
v_Groundwater = \\\\Computer\\AutoSitesShp\\sitefile_01.mdb\\GW
GW = "\\\\Computer\\AutoSitesShp\\AutoGW"
# Process: Make XY Event Layer (GW)...
print "Making XY Event Layer (GW)..."
gp.MakeXYEventLayer_management(v_Groundwater, "dec_long_va", "dec_lat_va", GWLayer, "GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision")
# Process: Copy Features...
print "Copying features (GW)..."
gp.CopyFeatures_management(GWLayer, GW, "", "0", "0", "0")
GWLayer =0
v_Groundwater = 0
GW = 0
# Clear local variables
v_Surface_Water___Layer = 0
SW = 0
XY_Table = 0
v_Surface_Water__ = 0
# Set OverWriteOutput back to false
gp.OverWriteOutput = 0
print "Done."