[Compiler-sig] Convert table with xy coordinates to feature class in GIS

Neal Norwitz nnorwitz at gmail.com
Wed Jan 23 20:59:58 CET 2008


Hi Barry.

This mailing list is not a great place to ask this question. It would
be best to direct it to python-list at python.org (the comp.lang.python
newsgroup).

Cheers,
n

On Jan 22, 2008 9:12 AM, Barry Guidry <BGuidry at pantex.com> wrote:
> 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")
>
>
> _______________________________________________
> Compiler-sig mailing list
> Compiler-sig at python.org
> http://mail.python.org/mailman/listinfo/compiler-sig
>


More information about the Compiler-sig mailing list