Getting each points distance / time


Using GraphHopper 0.3 dependencies and getting instructions;

    // Continue with all of the Graphhopper stuff
    request.putHint("calcPoints", false);
    request.putHint("instructions", true);
    request.setVehicle("car"); // "car"
    GHResponse route = graphHopper.route(request);
    InstructionList il = route.getInstructions();
    // iterate over every turn instruction
    for(Instruction instruction : il) {
       System.out.println(instruction.getDistance() + " Meters");

This results in;
21.15096859883932 Meters

0.0 Meters

16.896515906676814 Meters

0.0 Meters

63.869742532743004 Meters

(-41.22069849567186,174.81825276803045), (-41.220639263554794,174.8180629644855)
//etc etc…

I’m wondering a couple of things;
Is the instruction.getDistance() displaying the distance to get to the next point?
Also, why do some points have multiple Lat/Longs? Is this turning points? eg. intersections?
I’m presuming these lat/longs are points on the road, not lat/longs of the entered point.

I updated it to 0.7 just fine

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Powered by Discourse