EDIT: I've revamped this answer after realizing that Linear Referencing supports determining the side along a line.
The best approach to this problem is to use the Linear Referencing toolbox in ArcGIS:
A linear reference system stores data using a relative position along existing line features. That is, location is given in terms of a known linear feature and a position, or measure, along it. For example, route I-10, mile 23.2, uniquely identifies a position in geographic space, and can be used instead of an x,y coordinate.
Here's how you would do it, assuming we're using the streets and lines below:
Run the Create Routes (Linear Referencing) tool with your streets as your in_line_features
. Pick a unique ID field for the route_id_field
parameter. You can leave all other parameters as their defaults.
Run the Locate Features Along Routes (Linear Referencing) tool with your points as the in_features
, the routes we created above as the in_routes
, and the street ID field as your route_id_field
. You should change your radius_or_tolerance
such that there's enough distance from your streets to capture all of your points. Lastly, uncheck the m_direction_offsetting
parameter; this will make it such that the left/right designation is based on the digitization direction of your streets rather than the more arbitrary direction of your routes.
In your output table (shown below), you will have one row for each point. The value in the MEAS
field represents the distance along the street that the point is located. The value in the Distance
field represents the distance from the point to the snapped nearest location in your street, where the sign of the distance indicate the side of the street. So negative values indicate points to the left of the street and positive values indicate points to the right of the street.
To iterate through your left-side points, sort the table by RID
and MEAS
and skip positive values; do the same but reverse the sorting of MEAS
and skip negative values to iterate through your ride-side points in reverse order. It's probably easiest to sort in Python:
points = []
cursor = arcpy.da.SearchCursor(eventTable, ["RID","MEAS","Distance","OBJECTID"])
for row in cursor:
if row[2] < 0: #negative value = digitized left
points.append((row[0],"L",row[1]))
else: #positive value = digitized right
points.append((row[0],"R",row[1]*-1.0)) #negate MEAS to reverse direction
points.sort() #will break ties when sorting using 2nd or 3rd element in tuple
print [point[3] for point in points]
This results in our points sorted by street ID, then left side from start to end, then right side from end to start:
[9, 11, 12, 10, 8, 1, 4, 6, 5, 3, 2, 7]
Best Answer
In case this is helpful to others, i was able to create the following python code using arcpy which will place points at a specified interval based on an input line feature layer.