Move tool

3074
8
Jump to solution
06-20-2016 03:20 AM
BenLeslie1
Occasional Contributor III

Is there a tool (or workflow) available in Python that will move a shapefile to a new geographical location according to delta X, delta Y parameters (like what Shift_management does to rasters)?

I have Arc 10.2 Intermediate.

I am aware of the Move tool in ET GeoWizards but unfortunately I do not have a licensed version so it's not available to me in Python (and I have no prospect of licensing it, or any other tool).

I ask because I have a template shapefile (at 0,0) which contains an array of points and I want to copy and move this template into around 6000 new locations.  The template shapefile contains around 250 points.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
FC_Basson
MVP Regular Contributor

Following up from my previous post, you can do this with your selected features:

with arcpy.da.UpdateCursor(features_layer, ['SHAPE@XY']) as cursor:
  for row in cursor:
      cursor.updateRow([[row[0][0] + (x_shift or 0), row[0][1] + (y_shift or 0)]])

View solution in original post

8 Replies
FC_Basson
MVP Regular Contributor

About spatial adjustment rubbersheeting—Help | ArcGIS for Desktop

It might not be exactly what you are looking for, but have a look.

BenLeslie1
Occasional Contributor III

Yes, thanks, I could use those tools but I don't see how to access them via Python - is it possible?

0 Kudos
FC_Basson
MVP Regular Contributor

The tool is in the Editing Tools -> Conflation toolset.  Open the Rubbersheet Features tool and view the tool help for the Python code examples.

0 Kudos
BenLeslie1
Occasional Contributor III

Arg - correction:  I can't use them... Advanced licence required, I'm on intermediate.

0 Kudos
FC_Basson
MVP Regular Contributor

Here's a post that might help: Move Features

FC_Basson
MVP Regular Contributor

Following up from my previous post, you can do this with your selected features:

with arcpy.da.UpdateCursor(features_layer, ['SHAPE@XY']) as cursor:
  for row in cursor:
      cursor.updateRow([[row[0][0] + (x_shift or 0), row[0][1] + (y_shift or 0)]])
BenLeslie1
Occasional Contributor III

The Mark Correct button isn't working in my browser (Timothy Hales​ [Firefox 17.0.6]) but thank you, that works for me.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Ben, I marked FC Basson's answer as correct for you.   I'm not sure if that version of Firefix would block you marking the answer correct or not, but make sure you are not viewing with the geonet inbox.  Right click on the title and oone in a new tab usually works.  That is also needed for using the advanced editor for formatting and /or adding attachments, etc. just andfyi.