3

I have a lot of points. In the attribute table I have the coordinates(coordx / coordy).

How can I move all points, so that they are corresponding to the coordinates value in the attribute table?

  • 3
    What software are you using? – Knightshound Apr 26 '17 at 8:30
  • Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. – PolyGeo Apr 26 '17 at 8:45
  • 1
    Why not export the attribute table and import that again with "Add XY Data". – blu_sr Apr 26 '17 at 12:33
3

You may do this within field calculator, see blog:

How to Update the Location of a Point Feature and Its XY Fields

def XYsetVALUE( shape, X_value, Y_value):
   point = shape.getPart(0)
   point.X = X_value
   point.Y = Y_value
   return point

__esri_field_calculator_splitter__
XYsetVALUE ( !SHAPE!, !X_COORD!, !Y_COORD! )
2

One way to do it is to use the UpdateCursor in the Python Window. Be sure to backup your data before executing:

import arcpy

feature_class=r'C:\TEST.gdb\points' #Change path and name to fc
fieldlist=['X_field','Y_field'] #Change field names to match your data

tokens=['SHAPE@X','SHAPE@Y']
with arcpy.da.UpdateCursor(feature_class,fieldlist+tokens) as cursor:
    for row in cursor:
        row[2]=row[0]
        row[3]=row[1]
        cursor.updateRow(row)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.