Hiyas,
Using GraphHopper 0.3 dependencies and getting instructions;
// Continue with all of the Graphhopper stuff request.putHint("calcPoints", false); request.putHint("instructions", true); request.setWeighting("fastest"); 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.getPoints()); System.out.println(instruction.getDistance() + " Meters"); }
This results in;
//Point1
(-41.221259868375725,174.81792655038097)
21.15096859883932 Meters
//Point2
(-41.22108557520384,174.81802783337614,0.0)
0.0 Meters
//Point3
(-41.22108557520384,174.81802783337614)
16.896515906676814 Meters
//Point4
(-41.22122480983089,174.8179469231494,0.0)
0.0 Meters
//Point5
(-41.22122480983089,174.8179469231494)
63.869742532743004 Meters
//Point6
(-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.
edit
I updated it to 0.7 just fine