[GraphHopper] [Graphhopper]Next Instructions

Fred Laurent fredlaurent31 at gmail.com
Tue May 26 13:52:50 UTC 2015


Hello,
I create an app using graphhopper and I'd like to have the next Instruction
.
In instructionList.java class I find :
 /**
     * This method is useful for navigation devices to find the next
instruction for the specified
     * coordinate (e.g. the current position).
     * <p>
     * @param maxDistance the maximum acceptable distance to the
instruction (in meter)
     * @return the next Instruction or null if too far away.
     */
    public Instruction find( double lat, double lon, double maxDistance )

and I use this method in my app .. My code :
.
.
.
 protected void onPostExecute( GHResponse resp )
                {
                    if (!resp.hasErrors())
                    {

                        log("from:" + fromLat + "," + fromLon + " to:" +
toLat + ","
                                + toLon + " found path with distance:" +
resp.getDistance()
                                / 1000f + ", nodes:" +
resp.getPoints().getSize() + ", time:"
                                + time + " " + resp.getDebugInfo());
                        logUser("the route is " + (int) (resp.getDistance()
/ 100) / 10f
                                + "km long, time:" + resp.getTime() /
60000f + "min, debug:" + time
                        + " Instructions
"+resp.getInstructions().find(current_Lat,current_Long,20));

...}
the problem is resp.getInstructions().find(lat_double,lng_double,20))
return NULL ... Why? I don't understand
Thank You..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150526/b39cf40e/attachment.html>


More information about the GraphHopper mailing list