[GraphHopper] Android : java.lang.IndexOutOfBoundsException: Invalid index 33, size is 9
Peter K
peathal at yahoo.de
Fri Jul 19 08:25:13 UTC 2013
Hi Alex,
> error : 07-22 06:17:31.835: E/AndroidRuntime(8018): Caused by:
java.lang.IndexOutOfBoundsException: Invalid index 33, size is 9
hmmh, this does not look right. Would you open an issue for it? To solve
this I'll need the OSM file you used and the coordinates for the route
to reproduce this.
> note that I hade to specify EncodingManager manually otherwise I had
another error ... saying
> No vehicles are defined (no encoding manager set)
If you only load the graph (which is what you do under Android) you
normally don't need this. So probably something else is wrong (but I'll
have a look into it while I'm investigating the other issue)
Regards,
Peter.
> Ok I got a little further by following wiki instructions to the letter
> and generating the propper android jar :)
>
> Now the following commands make me have the graphhopper loaded
> successfully but when trying to query for a route I get and error :
>
>
> load :
>
> GraphHopper tmpHopp = new GraphHopper()
> .forMobile()
> .encodingManager(new EncodingManager("CAR"))
> .chShortcuts(true, true);
> tmpHopp.load(app.getOpenedBookRoutingFolder());
>
> //note that I hade to specify EncodingManager manually otherwise I had
> another error ... saying //No vehicles are defined (no encoding
> manager set)
>
>
>
> query :
>
> GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon)
>
> .algorithm("dijkstrabi").putHint("douglas.minprecision", 1);
> GHResponse resp = hopper.route(req);
> return resp;
>
>
>
> error :
>
> 07-22 06:17:31.835: E/AndroidRuntime(8018): Caused by:
> java.lang.IndexOutOfBoundsException: Invalid index 33, size is 9
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> java.util.ArrayList.get(ArrayList.java:304)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.storage.MMapDataAccess.getInt(MMapDataAccess.java:271)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.storage.GraphStorage.getOtherNode(GraphStorage.java:405)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.storage.GraphStorage.access$600(GraphStorage.java:49)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.storage.GraphStorage$EdgeIterable.next(GraphStorage.java:577)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.util.XFirstSearch.start(XFirstSearch.java:65)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.storage.index.Location2NodesNtree$1.execute(Location2NodesNtree.java:545)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> gnu.trove.impl.hash.TIntHash.forEach(TIntHash.java:178)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.storage.index.Location2NodesNtree.findClosest(Location2NodesNtree.java:543)
> 07-22 06:17:31.835: E/AndroidRuntime(8018): at
> com.graphhopper.GraphHopper.route(GraphHopper.java:456)
>
>
>
>
>
>
> What am I doing wrong ?
>
> Thanks a lot for your help :)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130719/0d7899ad/attachment.html>
More information about the GraphHopper
mailing list