I have a line and some points along with line, but they are not equally distanced from line. I want to align them at equal distance along the line, let's say, every point should be at a distance of 10 meter from the line.

Problem Image

I want to make an Python script for this, but don't know where to start.

  • Have you tried gis.stackexchange.com/questions/1394/…? – SIslam Feb 3 '16 at 9:07
  • Have you looked at Linear Referencing? – PolyGeo Feb 3 '16 at 9:09
  • i was trying to understand liner referencing what i could understand that it creates a new dbase table. and may not be useful to actually realign the points itself. – Akhil Kumar Feb 3 '16 at 9:16

You could make a buffer along your line, then convert this buffer to polyline and finally use snap tool to snap points on this line. Python code should looks like this:

import arcpy

# Set workspace
arcpy.env.workspace = r"path_to_your_workspace"

# Set variables
line_feature = "your_line_feautre.shp"
point_feaure = "your_point_feature.shp"
distance_from_line = "10 Meters" # distance for buffer

buffer_feaure = "in_memory" + "\\" + "buffer" # temporary feature
line_from_buffer = "in_memory" + "\\" + "line" # temporary feauture

# Make buffer along line
arcpy.Buffer_analysis(line_feature, buffer_feaure, distance_from_line)

# Convert buffer to polyline
arcpy.PolygonToLine_management(buffer_feaure, line_from_buffer)

# Snap points to line
distance_for_snap = "20 Meters" # distance for include points to snap
arcpy.Snap_edit(point_feaure, [[line_from_buffer, "EDGE", distance_for_snap]])

# Delete

You could see the help for tools: Buffer, Polygon to Line and Snap tool.

  • Glad to help you! – david_p Feb 3 '16 at 9:53

Your Answer

