Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

What is the difference between data access's “SHAPE@XY” and “SHAPE@TRUECENTROID” tokens?

$
0
0

Data Access Search Cursor.

What, if anything, is the difference between the tokens "SHAPE@XY" and "SHAPE@TRUECENTROID"?

They returned the same coordnates on a test polygon:

>>> cursor = arcpy.da.SearchCursor("test", "SHAPE@XY")
>>> for row in cursor:
...     print row[0]
...     
(559389.3838043335, 4239093.201390337)

>>> cursor = arcpy.da.SearchCursor("test", "SHAPE@TRUECENTROID")
>>> for row in cursor:
...     print row[0]
...     
(559389.3838043335, 4239093.201390337)

enter image description here

It behaved the same way for a multipart polygon feature. Does it ever return different results?


Viewing all articles
Browse latest Browse all 767

Trending Articles