Posts: 157
Threads: 8
Joined: May 2010
Hi,
I also referred to it in thread:
http://forum.routeconverter.com/thread-2024.html that routeconverter downloads the wrong maps for graphhopper.
Now I'm trying to calculate a route with the offline version using grapphopper around Zwolle, Netherlands. It is downloading nordrhein-westfalen.
And when I try to route from Zoeterwoude, Nederland to Den Haag, Nederland, it tries to download the 15GB Europe-latest instead of the Netherlands map.
Why?
Can I perhaps help improving this? As the current algorithm or setup or whatever it is, is totally inacurrate.
Posts: 7,512
Threads: 226
Joined: Aug 2007
13.07.2015, 08:55
(This post was last modified: 13.07.2015, 08:56 by routeconverter.)
(12.07.2015, 20:11)hvdwolf Wrote: Can I perhaps help improving this? As the current algorithm or setup or whatever it is, is totally inacurrate.
The problem is that GraphHopper doesn't support a tile download like BRouter, i.e. it wants to have the routing data map for a region and then work with it.
Currently, I've solved this by determining the bounding box of the route and then finding the smallest routing data map that covers the bounding box of the route.
Code:
public DownloadFuture downloadRoutingDataFor(List<LongitudeAndLatitude> longitudeAndLatitudes) {
BoundingBox routeBoundingBox = createBoundingBox(longitudeAndLatitudes);
Downloadable downloadableForSmallestBoundingBox = null;
BoundingBox smallestBoundingBox = null;
for (File file : dataSource.getFiles()) {
BoundingBox fileBoundingBox = file.getBoundingBox();
if (fileBoundingBox != null && fileBoundingBox.contains(routeBoundingBox)) {
if (smallestBoundingBox == null || smallestBoundingBox.contains(fileBoundingBox)) {
downloadableForSmallestBoundingBox = file;
smallestBoundingBox = fileBoundingBox;
}
}
}
[..]
The resulting
downloadableForSmallestBoundingBox is then used to route the complete route. The only improvement I could imagine is to determine the
downloadableForSmallestBoundingBox for each pair of coordinates
--
Christian
Posts: 157
Threads: 8
Joined: May 2010
Im afraid you algorithm for that bounding box for the route doesn't work correctly. I did see that graphhopper downloads the osm.pbf files from geofabrik.
I mentioned that I calculated a route around Zwolle. The bounding box (I calculate) for the route is clearly and wide within the Netherlands and doesnt even come close to nordrhein-westfalen.
Same for Zoeterwoude to Den Haag: that bounding box is really and definitely inside the Netherlands. However, whichever route I try in the Netherlands, even if it is dead center in the Netherlands, never the netherlands-latest.osm.pbf is downloaded.
I'm not a java programmer so I do not entirely understand the code you are displaying, but I assume you estimate the route bounding box on the (min-latitude, min-longitude), (max-latitude, min-longitude), (max-latitude, max-longitude) and (min-latitude, max-longitude) of all the route points given.
(Or otherwise: bottom-left, top-left, top-right, bottom-right)
Posts: 7,512
Threads: 226
Joined: Aug 2007
(14.07.2015, 21:37)hvdwolf Wrote: Im afraid you algorithm for that bounding box for the route doesn't work correctly.
It does - but the data is faulty: the europe/netherlands-latest.osm.pbf has no bounding box
I'll try to figure out, why.
--
Christian
Posts: 7,512
Threads: 226
Joined: Aug 2007
15.07.2015, 16:00
(This post was last modified: 15.07.2015, 16:01 by routeconverter.)
(15.07.2015, 11:57)routeconverter Wrote: I'll try to figure out, why.
The bounding box calculation for the .osm.pbf files from download.geofabrik.de is unstable. But I've managed to add bounding boxes for Netherlands and Luxembourg and some other countries. Still this needs to be improved and I'll be working on it.
--
Christian
Posts: 7,512
Threads: 226
Joined: Aug 2007
Almost every .osm.pbf files from download.geofabrik.de has a bounding box now as you can see on
http://api.routeconverter.com/v1/datasou...format=xml
Does it work better now?
--
Christian
Posts: 157
Threads: 8
Joined: May 2010
19.07.2015, 13:07
(This post was last modified: 19.07.2015, 13:09 by hvdwolf.)
I downloaded the latest offline prelease for linux today (19 July) and that one does download Netherlands when using graphhopper, but once downloaded it never calculates a route. Neither after restarting.
Then I wanted to calculate a route in and around York (leaving for England tonight) and it downloaded north-yorkshire but again it doesn't calcualte a route. I tried also to calculate a route of about 1-2 km but no route is calculated.
I find in the RouteConverter.log:
jul 19, 2015 2:08:00 PM slash.navigation.graphhopper.GraphHopper initializeHopper
WARNING: Cannot initialize GraphHopper: java.lang.ArrayIndexOutOfBoundsException: 0
jul 19, 2015 2:08:03 PM slash.navigation.gui.SimpleDialog dispose
INFO: Storing dialog options location as java.awt.Point[x=687,y=117]
Posts: 157
Threads: 8
Joined: May 2010
And then it crashed my chromebook!!
After reboot it calculated the route in York.
But it did not calculate the route in the Netherlands. So I tried to calculate a route inside Zwolle, my hometown, and it started downloading the dach map. The alps zone of Germany-Austria-Switzerland is not even close (would be nice during the winter though).
Posts: 7,512
Threads: 226
Joined: Aug 2007
(19.07.2015, 13:07)hvdwolf Wrote: I downloaded the latest offline prelease for linux today (19 July) and that one does download Netherlands when using graphhopper, but once downloaded it never calculates a route. Neither after restarting.
I find in the RouteConverter.log:
jul 19, 2015 2:08:00 PM slash.navigation.graphhopper.GraphHopper initializeHopper
WARNING: Cannot initialize GraphHopper: java.lang.ArrayIndexOutOfBoundsException: 0
An exception which stop the route calculation. Now the stacktrace would be really helpful.
--
Christian
Posts: 157
Threads: 8
Joined: May 2010
Stack trace? Please give some advice.Where do I find that?