[OSRM-talk] Shortest path post-processing

Francis Giraldeau francis.giraldeau at gmail.com
Sun Dec 13 21:05:28 UTC 2015


Hello!

I would like to do some post-processing on the resulting shortest path
using edges from the graph. In ViaRoutePlugin, I tried to iterate on the
raw_route.unpacked_path_segments, but the BeginEdges(node) and
EndEdges(node) returns an empty range as if the a segment is not connected
to the next.

for (std::vector<PathData> data: raw_route.unpacked_path_segments) {

    std::cout << "DEBUG FOR EACH NODE:" << std::endl;

    for (int i = 0; i < data.size(); i++) {

        PathData path = data[i];

        std::cout << "[" << facade->BeginEdges(path.node) << ", " <<

                     facade->EndEdges(path.node) << "]" << std::endl;

        for (const auto edge : facade->GetAdjacentEdgeRange(path.node)) {

            std::cout << edge << std::endl;

        }

    }

}


What would be the right way to iterate on segments and access the EdgeData?


Thanks!


Francis Giraldeau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20151213/6228ee60/attachment.html>


More information about the OSRM-talk mailing list