How to reorder the segments so entry #1 in the Shapefile will be "Segment 1", and the consecutive entry will be a segment which:
- Share same coordinate point geometry (Blue dot example: "Your end is my beginning").
- First coordinate point geometry is the closest to the last coordinate of previous segment (Orange & green dots example).
The logic here is that sometimes a physical road LineString explicitly separated into Lines (segments), and sometimes mistakenly a small gap can exist. (actually I think that most of the times condition 2 will met, because if 2 segments share same Geometry point, They also probably will be connected as single LineString)
Note- The question is just how to find the ordering and reorder (The next step will be to form single LineString either by connecting via the share coordinate or by connecting Last->First coordinates of consecutive lines).
With Join Multiple Lines plugin It's possible to merge segments "As Expected" in the above example, including removing duplicate node (blue).
The problem that it merge all other attributes into single one: For example column "ID" so will be only id=1.
Then applying Explode Lines tool, splits the merged line back to segments at nodes with the correct order, however because of what mentioned at point 2 - the data inside the attributes is lost.