XYsetVALUE not supported in ArcGis Pro

786
5
Jump to solution
08-31-2018 07:27 AM
AdminValorInmueble
New Contributor III
Hi, I was investigating on my own, but I did not get a solution.
I need to move points in a massive way to specific coordinates, 
I found a phyton code that makes it perfect in ArcMap,
but the problem is that the points are a feature service, 
and in ArcMap it is not so easy to edit, and the service is very heavy for a local copy, 
then, I thought I would do it directly in ArcGis Pro, but I get the following error:


some idea of how to do this process in ArcGis Pro?
Thanks!
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

I just tried this and it worked:

The reason might be the fact that you are returning a point object when the geometry is a PointGeometry object.

Code Block:

def Move2NewLoc(pntg, x, y):
    pntg_new = arcpy.PointGeometry(arcpy.Point(x, y), pntg.spatialReference)
    return pntg_new

View solution in original post

5 Replies
DanPatterson_Retired
MVP Emeritus

did you validate the expression?

0 Kudos
XanderBakker
Esri Esteemed Contributor

I just tried this and it worked:

The reason might be the fact that you are returning a point object when the geometry is a PointGeometry object.

Code Block:

def Move2NewLoc(pntg, x, y):
    pntg_new = arcpy.PointGeometry(arcpy.Point(x, y), pntg.spatialReference)
    return pntg_new
AdminValorInmueble
New Contributor III

It works perfect,

thank you so much, you have save my life !

0 Kudos
XanderBakker
Esri Esteemed Contributor

You're welcome. Glad it worked. Please mark the post as the correct answer for others to find this answer easier.

0 Kudos
MiguelMartinezYordan
Occasional Contributor

Hi, for some reason, this code used to work, but now is moving all points to the west African cost (see attachment). Any suggestion???

0 Kudos