Assemble the Shortest Path
This method three arguments: the start point, the last point added to the ready list, and the end point. It does the following:
NoteIn this case the start
point is (1905927, 472596), the last point is (1905929, 472103),
and the end point is (1905442, 472111).
- Clear the shortest path list.
- Assign last and end point arguments to local variables.
- Determines
that the last and end points are not the same, gets the links neighboring
the end point. This is described in the topic Get Neighbor Links.NoteTwo links are returned. The first has points (1905106, 472138) and (1905936, 471768). The second has points (1905442, 472111) and (1905929, 472103).
- For
each of the links, determines that the last point is the same as
one of the boundary points of the link, extracts the feature identifier from
the link data structure and adds the feature identifier to the shortest path
list.NoteThe last point (1905929, 472103) shows up in the second link so the feature ID (1606) for this link is added to the shortest path list.
- Follows
the trail of previous points starting with the last point argument.
Gets the links that neighbor the point. For each of these links does
what is specified in the bulleted list. After exiting the loop processing the
links, sets the point tested in the outer loop to the value of that
loop’s previous point. Once the outer loop terminates the shortest
path list contains the feature IDs of all of the links that constitute
the shortest path between the start and end points of the network
trace.
- Goes to the next link if the point does not intersect one of the link’s boundary points.
- Adds the link’s feature id to the shortest path list and breaks out of the link loop if the point’s previous point intersects one of the link’s boundary points.