[Compiler-sig] Convert table with xy coordinates to feature class in GIS
Barry Guidry
BGuidry at pantex.com
Tue Jan 22 18:12:05 CET 2008
I am trying to convert a table with x,y coordinates to an ArcGIS feature
class. I am not experienced with Python scripting, so below is the
example of a python script exported from Modelbuilder. I cannot find a
way to change the tool "Create Feature Class" to get input from the
"SDE.WELL_TEST". Here is the order of parameters of the Create Feature
Class tool: (Note, the parameters in brackets like { } are optional).
CreateFeatureClass_management <out_path> <out_name> {POINT | MULTIPOINT
| POLYGON | POLYLINE} {template;template...} {DISABLED |
SAME_AS_TEMPLATE | ENABLED} {DISABLED | SAME_AS_TEMPLATE | ENABLED}
{spatial_reference} {config_keyword} {spatial_grid_1} {spatial_grid_2}
{spatial_grid_3}
Any help is appreciated.
Python script:
#
---------------------------------------------------------------------------
# TabletoFeature.py
# Created on: Tue Jan 22 2008 10:50:51 AM
# (generated by ArcGIS/ModelBuilder)
#
---------------------------------------------------------------------------
# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Load required toolboxes...
gp.AddToolbox("D:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data
Management Tools.tbx")
# Local variables...
Well_test = "D:\\test\\Well_Annotation.mdb\\Well_test"
SDE_WELL_TEST = "Database Connections\\apps1.sde\\SDE.WELL_TEST"
XYWells = "D:\\test\\Well_Annotation.mdb\\XYWells"
# Process: Copy Rows...
gp.CopyRows_management(Well_test, SDE_WELL_TEST, "")
# Process: Create Feature Class...
gp.CreateFeatureclass_management("", "XYWells", "POINT", "",
"DISABLED", "DISABLED", "", "", "0", "0", "0")
More information about the Compiler-sig
mailing list