1

I have two point feature classes, and need to move the points of one feature class to match that of the other feature class. Normally, I would just do them by hand, using the move tool but the classes have over 10,000 records each so it isn't a feasible option. They do share a common field called 'Account #', but I am unsure of how to proceed with such a large set of data. Are there specific geoprocessing tools I could use, or any ArcPy tools I could create some kind of script with to do this process?

I am currently using ArcGIS Pro 3.1.0.

3
  • 1
    Have you looked at the snapping tools?
    – John
    Commented Mar 17, 2023 at 15:55
  • 1
    Easiest would be to create a script with a DA SearchCursor to make a dictionary of PointGeometry by AcctNo, then a one-pass DA UpdateCursor to lookup replacement point by AcctNo. It would probably take seconds to run.
    – Vince
    Commented Mar 17, 2023 at 16:31
  • Both comments above are valid, but the snap could potentially lead to problems if you have multiple points within the search distance. You do not describe if the points are random, gridded, offset or nearby. May be if you edited your question and upload a couple of images that will help?
    – Hornbydd
    Commented Mar 17, 2023 at 17:20

2 Answers 2

2

enter image description here

arcpy.AddGeometryAttributes_management(Input_Features="correct_geometry", Geometry_Properties="POINT_X_Y_Z_M", Length_Unit="", Area_Unit="", Coordinate_System="")
arcpy.JoinField_management(in_data="wrong_geometry", in_field="ACCOUNT", join_table="correct_geometry", join_field="ACCOUNT", fields="POINT_X;POINT_Y")
arcpy.CalculateField_management(in_table="wrong_geometry", field="Shape", expression="arcpy.Point( !POINT_X!, !POINT_Y!)", expression_type="PYTHON_9.3", code_block="")

enter image description here

0

Here's a way to do it with ArcPy using Cursors:

ref_points = r"...\gdb\ref_points"
mov_points = r"...\gdb\mov_points"

with arcpy.da.UpdateCursor(mov_points, ['Shape@', 'Account']) as mov_cursor:
    with arcpy.da.SearchCursor(ref_points, ['Shape@', 'Account']) as ref_cursor:
        for mov_row in mov_cursor:
            for ref_row in ref_cursor:
                if mov_row[1] == ref_row[1]:
                    mov_row[0] = ref_row[0]
                    mov_cursor.updateRow(mov_row)
                    break
            ref_cursor.reset()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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