| Forum | GitHub | Maps | Blog

"Point 0 is out of bounds" Exception with custom osm file



i’m having some issues perform routing with a custom and simple graph defined with JOSM.

Here’s the code for routing part:

GraphHopper hopper = new GraphHopperOSM()
            .setEncodingManager(new EncodingManager("bike"))


 double[] pointA = new double[]{27.39085347684,-19.41636378195};
 double[] pointF = new double[]{-0.34328022112,15.87322430068};

 GHRequest req = new GHRequest(pointA[0], pointA[1], pointF[0], 
 req.getHints().put(Parameters.Routing.INSTRUCTIONS, "true");
 GHResponse resp = hopper.route(req);

 PathWrapper wrapper = resp.getBest();

and i receive the exception

  Point 0 is ouf of bounds: 27.39085347684,-19.41636378195

Heres’ the BBox values:

minLon = -19.41636359877207
maxLon = 15.87322430068
minLat = -0.34328022112
maxLat = 36.13078721876

what is wrong ?

the .osm file can be located here:




might be a little bit too small. Try -19.4163635



thanks for your answer.

Actually the values you are talking about @karussell are calculated by graphhopper algorithm (not embedded in osm file).

What i did was, in JOSM, turning on the satellite imagery and what i saw was it was a graph that covered half planet. So i size it down and gave to it a more reasoned dimensions and inputted boundin box (calculated by hands) a bounding box and now seems to give me a path (not the sortest, to be honest).

The strange things is i have to remove the graphhopper wokring directory everytime to make it work. Any idea for this ?



reading other response i found that i have to call clean()