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

Polygon Centroid

$
0
0
I am attempting to create a script that zooms to a polygon centroid. I want the polygon centroid to be based on a Subd attribute field. Location is a feature class and I intend to use the SHAPE@XY to zoom to the polygon centroid. I am receiving an RuntimeError: Invalid SQL statement.

Code:

centroid = "SHAPE@XY"
spatialref = arcpy.Describe("Location").spatialReference
cursor = arcpy.da.SearchCursor("Location", "Subd", centroid, spatialref)       
row[0] = Subd
del row
del cursor


Viewing all articles
Browse latest Browse all 2485

Trending Articles