2

I am trying to compare a set of point features to the centroid of a single feature polygon using ArcPy. The problem is that the polygon generates a set of XY coordinates in meters, whereas the set of points generates a set of XY coordinates in decimal degrees.

Is there anyway to ensure consistency?

Using some variations of SHAPE@XY@DECIMALDEGREES threw errors. When I do the following:

with arcpy.da.SearchCursor("prim_catch_dissolved", ["TR", "SHAPE@XY"]) as cursor:

I get the results in meters, which is not what I'm after.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
baobobs
  • 411
  • 2
  • 5
  • 15
  • 1
    I think this may be a duplicate of http://gis.stackexchange.com/questions/8163/arcgis-arcpy-python-how-to-get-latitude-and-longitude-of-a-projected-point – PolyGeo Dec 22 '14 at 22:52

1 Answers1

3

Use the spatial_reference parameter to reproject on-the-fly.

with arcpy.da.SearchCursor("prim_catch_dissolved", ["TR", "SHAPE@XY"], spatial_reference=arcpy.SpatialReference("WGS 1984")) as cursor:
    # Do interesting things here
Jason Scheirer
  • 18,002
  • 2
  • 53
  • 72