import arcpy
def shift_featuresXY(in_features, x_shift=None, y_shift=None):
"""
English:
This Script Provide By "Fazel Shahcheragh:http/gislab.blog.ir",shahcheragh_gis@yahoo.com
In Order to Shift Features in a shape file
in_feature:the interest layer
x_feature: x shift
y_feature:y shift
Finglish:
in script tavasote Fazel Shahcheragh b manzoore shifte mokhtasati avarez mojood dar yek laye d
dar yek laye tahaye shodeh ast:http/gislab.blog.ir,shahcheragh_gis@yahoo.com in_feature:layeye morede nazarx_feature: shift dar jahate x
y_feature:shift dar jahate y
"""
with arcpy.da.UpdateCursor(in_features, ['SHAPE@XY']) as cursor:
for row in cursor:
cursor.updateRow([[row[0][0] + (x_shift or 0),
row[0][1] + (y_shift or 0)]])
return