Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy
- from random import *
- rows = arcpy.UpdateCursor(r"C:\new_shapefile2.shp")
- shape = arcpy.Describe("C:\new_shapefile2.shp").shapeFieldName
- increment = range(-50,50,5)
- pos_neg = [-1,1]
- for n,row in enumerate(rows):
- if n > 0:
- point = arcpy.Point(row.getValue(shape).getPart(0).X + (increment[n]*pos_neg[randrange(0,2,1)]), row.getValue(shape).getPart(0).Y + (increment[n]*pos_neg[randrange(0,2,1)]))
- row.setValue(shape, point)
- rows.updateRow(row)
- del rows
Add Comment
Please, Sign In to add comment