Here's the help article on Geometry object properties
Geometry—Help | ArcGIS Desktop
I also found two lists of geometry tokens (SHAPE@foo), which should be shortcuts to Geometry properties. The second one is a little more complete.
SearchCursor—Help | ArcGIS Desktop
Working with NumPy in ArcGIS—Help | ArcGIS Desktop
Hi,
Running the same code as set out in the last post on a set of my own polygons (some of which are highly convoluted), I did not get identical results.
The coordinates returned by the 'SHAPE@XY' and 'SHAPE@TRUECENTROID' tokens were, without exception, identical. But for about 3% (29 of 1,038) of my polygons, the coords returned by getting centroid.X and centroid.Y from the geometry returned by the 'SHAPE@' token did not equal those returned by the other two tokens.
Like the original poster, I need points inside my polygons, rather than the 'true' centroids. I've found using the labelPoint property of the Polygon geometry object gets me what I need. I agree with J A that the documentation is less than clear, and that the results of using the different tokens are not what I would have expected.
The devil is, as always, in the details...
Cheers
for i in arcpy.da.SearchCursor("Ngaruawahia_StructurePlanAreas", ['SHAPE@', 'SHAPE@XY', 'SHAPE@TRUECENTROID']): ... print (i[0].centroid.X,i[0].centroid.Y), i[1], i[2] ... (1789821.778531158, 5820949.009319027) (1789821.778531158, 5820949.009319027) (1789821.778531158, 5820949.009319027) (1782710.746833228, 5828120.099465807) (1782710.746833228, 5828120.099465807) (1782710.746833228, 5828120.099465807) (1793174.7978348304, 5834627.9375800025) (1793174.7978348304, 5834627.9375800025) (1793174.7978348304, 5834627.9375800025) (1793743.185461287, 5824684.673387148) (1793743.185461287, 5824684.673387148) (1793743.185461287, 5824684.673387148) (1790026.8500248736, 5828569.732378332) (1790026.8500248736, 5828569.732378332) (1790026.8500248736, 5828569.732378332) (1791073.8189072697, 5832543.665935521) (1791073.8189072697, 5832543.665935521) (1791073.8189072697, 5832543.665935521) (1772783.6783350855, 5873593.864663156) (1772783.6783350855, 5873593.864663156) (1772783.6783350855, 5873593.864663156)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.