Quantcast

Convert table with xy coordinates to feature class in GIS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Convert table with xy coordinates to feature class in GIS

Barry Guidry
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
[hidden email]
http://mail.python.org/mailman/listinfo/compiler-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Convert table with xy coordinates to feature class in GIS

Bugzilla from nnorwitz@gmail.com
Hi Barry.

This mailing list is not a great place to ask this question. It would
be best to direct it to [hidden email] (the comp.lang.python
newsgroup).

Cheers,
n

On Jan 22, 2008 9:12 AM, Barry Guidry <[hidden email]> 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
> [hidden email]
> http://mail.python.org/mailman/listinfo/compiler-sig
>
_______________________________________________
Compiler-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/compiler-sig
Loading...