Least Cost Path for Connecting Start- and End-Points of Guard Rails

07-26-2016 05:53 AM
New Contributor II

Hey everyone:

I have been trying to connect start points and end points of guard rails along the sides of roads. Of course, this is more complicated than converting points to lines because I need to prevent the lines from crossing roads but keep them as close to the roads as possible when the roads are not perfectly straight.

I was wondering if it is possible to do this with a Least Cost Path model. Is LCP capable of connecting multiple start points with multiple end points based on an ID field?

This would allow me to assign very high costs to roads, lower costs to the area within 1 metre of roads, and higher costs as you go further away from the road. I have about 3400 start and end points for the guard rails.

Also, if anyone has any better ideas of how to do this workflow, I would be grateful for any advice.



0 Kudos
3 Replies
MVP Legendary Contributor

do you have an image of the guard rail post placement?

I wouldn't attempt this in raster world since I think the problem would best be solved in vector world.

My first thought would be to use a minimum spanning tree which in essence takes a point dataset or selection from therein and connects the points based on minimizing the overall distance.  I will defer a reference until after I see what the data set looks like to see if this is an appropriate suggestion or one that would have to be implemented selectively and/or incrementally

Esri Esteemed Contributor

Definitely wouldn't use a raster approach for this problem. The solution depends largely on the definition of the road geometry (so please as Dan suggests, include a screenshot of your data).

Let's give an example, to see if I understand you correctly and what a possibility may be (depending on the road geometry). You have this:

...but don't want this:

you are looking for this:

If you would have polygons that describe the road surface like this (blue polygon):

you could use some python code and :

  • extract the outline of the polygon:
    • polyline = polygon.boundary()
  • snap the start and end point to the line:
    • startpoint2 = polyline.snapToLine(startpoint)

    • endpoint2 = polyline.snapToLine(endpoint)

  • measure the points on the line:
    • start_measure = polyline.measureOnLine(startpoint2, False)
    • end_measure = polyline.measureOnLine(endpoint2, False)
  • extract the segment from the line:
    • guard_rail_line = polyline.segmentAlongLinestart_measure, end_measure, False)

Something like this.

But if you only have a center line of the road, things will be a little bit more complex.

New Contributor II


Thanks for the posts Dan and Xander:

I am going to work through the information you have provided me so far (I just got in to work). Xander was exactly right in his description of the problem.

The dotted red line in his second image is similar to the red line in the above image. The green line in Xander's third image is similar to the green lines in my image. The only missing line type would be the blue lines in the centre of my image where a highway overpass crosses a road and has guard rails along the side (green and red lines are the same).

Note: the light green polygon would be similar to the blue polygon in Xander's final image.

Thanks for the responses. I will go through Xander's work flow and get back to you.


0 Kudos