How to bulk move point features to new x,y coordinates?

5162
9
01-31-2022 08:12 AM
LLCCG
by
New Contributor III

I have a large point feature class, and I need to move a significant number of the features to new coordinates. 

I can use the Move To tool to do it one at a time, but it would be significantly better if I could take a table of coordinates and do it all in one. 

How could I do this? 

I don't think I can create a new feature, because I need the GlobalID to stay the same. 

0 Kudos
9 Replies
DanPatterson
MVP Esteemed Contributor

You think there would be a shift and rotate tool builtin, but alas

Calculate Field Python examples—ArcGIS Pro | Documentation

from there

Expression:
shiftXCoordinate(!SHAPE!)

Code Block:
def shiftXCoordinate(shape):
    shiftValue = 100
    point = shape.getPart(0)
    point.X += shiftValue
    return point

do the same for the Y


... sort of retired...
jcarlson
MVP Esteemed Contributor

Are the features shifting consistently, or differently per field?

The you can select multiple features in the Move To tool, right-click, and select Delta XYZ to enter the shift amount.

You can use the Transform tool to modify your features in place, too.

- Josh Carlson
Kendall County GIS
DanPatterson
MVP Esteemed Contributor

albeit,  the Transform requires an Advanced license, hence the old school suggestion for quick shifting


... sort of retired...
0 Kudos
LLCCG
by
New Contributor III

Unfortunately, they're shifting differently. We purchased a set of addresses, a number of which (mostly addresses for newly constructed roads) were only geocoded to a zip-code level. I'd like to update them with more accurate coordinates. Each address has a unique identifier, so I'd love to be able to make a table with the identifier, lat, and long, and be able to move the points to those new coordinates.

I thought about copying the attribute table for the records I want to change, adding lat and long columns, using the Display XY tool to locate them on the map, and then deleting the original features and appending the new feature class to the original feature class, but that would change the GlobalID for the address, which I can't do. 

0 Kudos
CMV_Erik
Occasional Contributor

If you need to preserve the original except for the geometry, you could:

  1. create a copy that includes a persistent unique ID attribute from a field in the original
  2. perfect the geometry in the copy
  3. join them using that unique ID
  4. re-calculate the original geometry using the attributes from the perfected copy
  5. drop the join

There's different ways to do something similar, but this is my generic no-coding-required approach to changing attributes in restricted tables and feature classes. I don't normally do this with geometry, but riffing on @DanPatterson's reply, I think you could set Shape properties from float attributes in the copy:

original.point.X = copy.corrected_longitude 
original.point.Y = copy.corrected_latitude 

 

CCMM
by
New Contributor II

If anyone (including OP) is still watching this thread... I have a similar problem except in my case I have photos attached to the feature class in the geodatabase and now I need to update the location of those points (about 1,000 of them) to the X,Y coordinates (lat/long) in the attribute table.  


So what I need to do is run a tool that will move the points to the latitude and longitude which I already have specified in the attribute table for each point. This seems like such a simple task for GIS and one that people run into often, but I cannot find any solutions. 

HELP!!

0 Kudos
CMV_Erik
Occasional Contributor

You can use Calculate Field for points. This post covers it pretty well: Solved: Updating Shape Field from Lat/Long Fields - Esri Community  The key is to make the result something ArcGIS will recognize as a geometry. 

A quick and dirty version that works for me is just this: arcpy.Point(!long!, lat!).

Try it on a backup first though! 

 

 

 

 

0 Kudos
CCMM
by
New Contributor II

I figured out a solution using UpdateCursor that was actually really simple! See script below.

import arcpy

 

# Set the local parameters

inFeatures = "Survey"

 

# Move the Features

with arcpy.da.UpdateCursor(inFeatures, ["SHAPE@XY","Longitude","Latitude"]) as cursor:

    for row in cursor:

        row[0] = ([row[1],row[2]])

        cursor.updateRow(row)

KeatonVeld
New Contributor II

Hey, I am interested in using this script for a similar situation with a photos geodatabase but I am not entirely familiar with how to correctly use it. Could you walk me through it? Like on what attribute are you using the field calculator for the script?

Please correct me if I am wrong but my assumptions are:

  • "Survey" is your feature class with the points to be moved (the one where you are using the field calc as well).
  • "Longitude" and "Latitude" are the x,y coords that you want the point to move to which have already been added into the attribute table.

Any help would be appreciated!

0 Kudos