I am relatively new to graph hopper, and I have been trying to run the Dijkstra using the low level api.
I wanted to run this api using a .osm.pbf file, so I chose the berlin-latest.osm.pbf file. I also set “car” as the profile.
I first create the graph hopper instance, and instead of creating the base graph in the low level api example, I get it from the hopper instance, but pretty much follow the same steps as shown in the low level api example
Now when I run the Dijkstra for 2 points in berlin, I always get infinity as the weight, and it is unable to find the route.
Thank you for your reply!
So here is what my output says, when I just printed out the “path”.
found: false, weight: 1.7976931348623157E308, time: 0, distance: 0.0, edges: 0
I went a bit further into the code and it seems like the weight for the first edge is constantly coming as positive Infinity, and it is unable to really process further. Any thoughts where I might be going wrong?
Or perhaps am I missing something from my code?
I can confirm the path is not found for berlin-latests.osm.pbf. This is strange, indeed. I’ll take a look.
Also, when I ran bidirectional algorithms, it was able to find the way in both the datasets.
Using berlin-latest.osm.pbf I cannot find a path for neither Dijkstra nor DijkstraBidirectionRef, or which one did you use? Did you make sure you deleted the graph folder after you changed the map file?
hopper.getLocationIndex().findClosest(52.5301592,13.388860, EdgeFilter.ALL_EDGES); will return the next possible snap that is closest to the given coordinate (the green marker). But since this is a footway and you are using a car profile this road is inaccessible and so the routing algorithm does not find a path. So you need to use an edge filter that skips the footway and snaps to Borsigstraße instead:
Thank you so much for you reply! This is really helpful.
To ensure that I can avoid these mishaps on my end going forward, I tried looking for documentation for some of these implementations, so that I will be able to know about features such as these → the default snap filter. I was not able to quite find them within the documentation provided on the github. Would you happen to know where can I find the documentation them? Or would I have to simply look through the code base?