[GraphHopper] Android : java.lang.IndexOutOfBoundsException: Invalid index 33, size is 9

Alex azlist1 at gmail.com
Fri Jul 19 14:44:29 UTC 2013


Ok just forget about my last two emails. It seems I once more had a version
mismatch between the android version and the windows version.

Thanks
On Jul 19, 2013 10:25 AM, "Peter K" <peathal at yahoo.de> wrote:

>  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 :)
>
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/graphhopper
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130719/d13793aa/attachment.html>


More information about the GraphHopper mailing list