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.
Solved! Go to Solution.
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)]])
About spatial adjustment rubbersheeting—Help | ArcGIS for Desktop
It might not be exactly what you are looking for, but have a look.
Yes, thanks, I could use those tools but I don't see how to access them via Python - is it possible?
The tool is in the Editing Tools -> Conflation toolset. Open the Rubbersheet Features tool and view the tool help for the Python code examples.
Arg - correction: I can't use them... Advanced licence required, I'm on intermediate.
Here's a post that might help: Move Features
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)]])
The Mark Correct button isn't working in my browser (Timothy Hales [Firefox 17.0.6]) but thank you, that works for me.
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.