Out of bounds, why?


Totally new to Graphhopper and I am using a local API version trying to get a first request working. I loaded the map of swedden and have this request:

the error is:
{“message”:“Point 0 is out of bounds: 0.0,36.0, the bounds are: -5.5190044,10.3005044,35.7094434,45.1135046”,“hints”:[{“message”:“Point 0 is out of bounds: 0.0,36.0, the bounds are: -5.5190044,10.3005044,35.7094434,45.1135046”,“details”:“com.graphhopper.util.exceptions.PointOutOfBoundsException”,“point_index”:0}]}

the point is just me trying to figure out what is wrong. This point should be inside the bounding box. What am I missing?

If you have only the map of Sweden, then obviously coordinates outside like this (Eastern Africa) will fail.

thanks. that’s for sure. What I don’t understand is how 0.0, 36.0 is out of bounds with these bounds:
"the bounds are: -5.5190044,10.3005044,35.7094434,45.1135046”

The point is not important, I just want to understand the bounds for now.

The bbox is given as minLon, maxLon, minLat, maxLat. So the -5…10 range is regarding the longitude. And the area is between this start and end location:

(but this is also not sweden!?)

thank you for your quick response.
Since I am very new to this, what could be a good point0 and point1 with these bounds ? again it doesn’t really matter what points, just so that I can get an answer from the API and go from there.

Not sure what you mean. If you import a pbf for a specific area then any coordinate inside this area is a “good” point.

You can also open http://localhost:8989/maps/ to see the bounds on the map and right click on the map to start and end a route and investigate the area a bit easier than with the /route endpoint.

Ahhh, actually the bounds on the map are in spain! But then I have another error: cannot find points.
I tried multiple points, clearly on a road but same error. So now, maybe there is definitively something wrong with my setup. One more info, actually I tried multiple maps and the bounds are always the same (as in the picture) though it looks like the map was read correctly. This is the command line I am using:

java -D"dw.graphhopper.datareader.file=sweden-latest.osm.pbf" -jar graphhopper*.jar server config-example.yml

I didn’t change the config-example and I deleted the cache but same result

I was able to make some progress:

  1. I loaded different maps (osm.pbf) from geofrabrik and some are “working”. For australia for example the bounding box is the whole bottom of earth but then I was able to get point in that bounding box. France bounding box is “perfect” and everything I wanted to do worked well.

  2. is there any way to manually set the bounding box of the file if I see it is not correctly calculated? (modifying graph-cache data ?) Like at this time sweden.osm.pbf doesn’t have the right bounding box (at least when I load it)


The bounding box is contained in the pbf file, so there is no way to change it. It looks as if you have a broken pbf file for Sweden. Have you tried to download it from geofabrik once again and deleted the graph folder before starting?