Changing order of segments in line features

4780
3
Jump to solution
09-16-2015 03:15 AM
JohannaKollin
New Contributor III

I´m trying to make routes out of existing roads. My problem is that no matter what I do to the line segments are in the wrong order. I´m working with a multipart shapefile. I need 1 feature for a whole road, with the same roadnumber and to do that I dissolved the lines that share the same roadnumber. But that does not let me choose in what order they are placed. I wished it would have started with where the road starts (from what direction it was drawn) but that was not the case.

I tried dissolving, I´ve flipped the lines to be in the same direction. I´ve manually tried to merge them in an edit session and even split them to dissolve them again hoping arcmap would rearenge the order. Those are the solutions I came across from different forums so far and they do not work. I´ve found nothing that helps when googling and I´m new to python so don´t know if I could do this in python somehow.

so right now I´m stuck with redrawing the lines by tracing those features that are in the wrong order and going through every feature to see in what order the segments are.

Some suggest using the unsplit tool as an option, but sadly i don´t have the license to use it, but reading about it I can´t tell if that is the right solution and it doesn´t help me since I can´t use it. Are there anyway to reorder the segments. feels like it is something that should be possible to do.

I even have problems with roundabouts, but those segments it´s easier to manipulate the measurements after I´ve created the routes if I need them to be correct. But my main problem is visualized in the picture. The red vertex that indicates the end point, is in the middle (shown here in the upper end of the pic)  but it should be located at the southest endpoint of the road.

roadsegments.png

0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Honored Contributor

I would use the Create Routes tool with lower left priority.  Branching messes up everything, so you need to isolate a simple single line main route to get this tool to build the lines in sequence correctly.  Roadway splits based on direction of travel have to be eliminated from the main route and you have to choose a single direction of travel as the main route if you want to control sequential measures.

For roads with lane splits around dividers, roundabouts, or right-turn only lane splits, I use two route name fields that build routes for each direction of travel (one field for either northbound or eastbound travel, and one field for either southbound or westbound travel).  The segments of the route that allow bidirectional travel get assigned route names for both fields, but the segments that allow travel in a single direction only get one of the fields assigned a route name.  So the right side of a roundabout in your picture gets a northbound route name and the left side of the roundabout gets a southbound route name.  Similarly the right side of the right-turn lane split gets a northbound route name and the left side of the right-turn lane split gets a southbound route name.  Then I build the two sides of the road as two routes using the Create Route tool on the segments with values in the appropriate direction of travel field.  If there is no branching the routes and measures will get built correctly for the one-direction of travel.

I also use the Locate Features along route to get measures for the individual segments that make up a route. By sorting on the measure values I can sequence them.  For my purpose I use the two separate halves for separate LR events.

In your case you could build one direction of travel route and then manually insert the other half of the roundabout and right-turn lane split manually later with manually assigned measures.  Those insertions would never sequence correctly anyway and would always remain as separate parts of the route, since no standard approach for sequence assignment exists at split locations.  Basically once you include splits like roundabouts, both sides have to end up with the exact same measures and sequence numbers, which screws up every tool Esri has created and cannot be reflected in the actual line geometry segmentation.

View solution in original post

3 Replies
DanPatterson_Retired
MVP Emeritus

Interesting problem but requiring a manual reconstruct when the line is disassembled.  There is no code, including ones employing lexicographic sorting, that will order all segments for all lines properly.  You could try to flip the segments and then flip them back to see if the desired order is created under the hood. Otherwise indicating the segment order would be the last resort and not easily implemented.

RichardFairhurst
MVP Honored Contributor

I would use the Create Routes tool with lower left priority.  Branching messes up everything, so you need to isolate a simple single line main route to get this tool to build the lines in sequence correctly.  Roadway splits based on direction of travel have to be eliminated from the main route and you have to choose a single direction of travel as the main route if you want to control sequential measures.

For roads with lane splits around dividers, roundabouts, or right-turn only lane splits, I use two route name fields that build routes for each direction of travel (one field for either northbound or eastbound travel, and one field for either southbound or westbound travel).  The segments of the route that allow bidirectional travel get assigned route names for both fields, but the segments that allow travel in a single direction only get one of the fields assigned a route name.  So the right side of a roundabout in your picture gets a northbound route name and the left side of the roundabout gets a southbound route name.  Similarly the right side of the right-turn lane split gets a northbound route name and the left side of the right-turn lane split gets a southbound route name.  Then I build the two sides of the road as two routes using the Create Route tool on the segments with values in the appropriate direction of travel field.  If there is no branching the routes and measures will get built correctly for the one-direction of travel.

I also use the Locate Features along route to get measures for the individual segments that make up a route. By sorting on the measure values I can sequence them.  For my purpose I use the two separate halves for separate LR events.

In your case you could build one direction of travel route and then manually insert the other half of the roundabout and right-turn lane split manually later with manually assigned measures.  Those insertions would never sequence correctly anyway and would always remain as separate parts of the route, since no standard approach for sequence assignment exists at split locations.  Basically once you include splits like roundabouts, both sides have to end up with the exact same measures and sequence numbers, which screws up every tool Esri has created and cannot be reflected in the actual line geometry segmentation.

JohannaKollin
New Contributor III

Thank you for your answer. I ended up manually editing those few lines that were wrong, and that will do for now. But maybe if I need to do it again on more road segments I might try your suggestion. Seems faster and  and like a more automated way to do it.

0 Kudos