Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Create duplicate polygons using Shape@ and Geometry objects in 10.1

$
0
0
Greetings All

I have a shapefile with 1 polygon in it. I want my script to read the geometry of the polygon and then create multiple polygons in the same file from the original polygon.

I can do this using Describe, ShapeFieldName & a polygon array. But I noticed new python functionality using Shape@WKT and FromWKT

The help section is truly lacking (even by ESRI standards) and I was wondering if anyone can help me join the dots.

It looks like you can use "Shape@WKT" to extract the polygon geometry and put it into a Geometry object, like so:

Code:

infc = "D:\\DDP_extent.shp"
infcFields = ["SHAPE@WKT"]

g = arcpy.Geometry()
gList = arcpy.CopyFeatures_management(infc, g)

The writing geometries help section only uses arrays as the input method, but surely I could use FromWkt to create a new geometry object for the InsertCursor?

Am I reading it right? or are arrays the only way to go?

Thanks in advance

Viewing all articles
Browse latest Browse all 2485

Trending Articles