You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better handling for missing ferry duration tags #2532
If there is no duration tag on a ferry we currently use speed=5km/h, or even smaller if the distance is below 300m. But for longer distance ferries this seems very likely too slow. Also I think not tagging duration for such longer ferries is a mapping error and if this happens frequently we should report it to OSM.
I checked a few statistics. I calculated the distance of all ferry OSM ways (route=ferry), the duration according to the duration tag and the resulting speed. As I already mentioned here: #2528 (comment) the duration tag is missing for the majority of ferries: For 21000 of 24000 (~87%) ferry ways there is no duration tag. This includes around 2100 'long' ferries (>20km) without a duration tag. For those that have a duration tag I created this histogram that shows the number of ferry ways for a given speed (in km/h):
Next, I created the same histogram, but limited the data depending to the distance of the ferry ways:
> 30km (only long ferries)
> 1km and < 30km (without short and long ferries)
< 1km (only very short ferries)
We clearly see that based on this data (all ferries with a duration tag) the ferries are faster for longer distances (no surprise, really). Typical speeds seem to be around 5km/h for short ferries < 1km (like river crossings etc.), 15km/h for medium distance between 1km and 30km, and around 30km/h for long distance ferries > 30km. This is roughly in line with the short/long/unknownSpeed we use for FerrySpeedCalculator:
Details
Here is the code I used to print the ferry way data: 73e55d4
I added `"com.graphhopper.reader.osm.OSMReader": TRACE` to `logging -> loggers` in `config.yml` to enable the logs, then search/replaced some text to convert it to csv (using ';' as separator) and added a header line with the column names. Then use some python to print the stats, e.g.
And here is one of the many examples where our time estimation is off because we apply a too slow speed in case the duration tag is missing (which it is for the majority of all ferries): 17.5h for 108km.
Another interesting thing to look at is the number of ferry routes with missing duration tag for each distance:
The bar at the far right shows the number of such ferry routes with a distance >=30km. We see that the majority of ferries without duration tag are short. However, there are also around 8000 medium ones (1km to 30km) (and still around 5000 between 3km and 30km), and around 1600 long ones (>30km). In total these are around 40% of all ferries. Currently they are too slow according to what we saw above. We use the 'unknownSpeed=5km/h' for all of them, but probably 15km/h for the medium ones and 30km/h for the faster ones would be a better fit.
Activity
easbar commentedon Mar 9, 2022
I checked a few statistics. I calculated the distance of all ferry OSM ways (
route=ferry), the duration according to the duration tag and the resulting speed. As I already mentioned here: #2528 (comment) the duration tag is missing for the majority of ferries: For 21000 of 24000 (~87%) ferry ways there is no duration tag. This includes around 2100 'long' ferries (>20km) without a duration tag. For those that have a duration tag I created this histogram that shows the number of ferry ways for a given speed (in km/h):all
We see data errors on both sides of the spectrum: Some ferries are too fast due to false duration tags. Many are too slow and I think this is because sometimes ferry routes are split into several OSM ways each of which contain the duration tag for the entire route like here for example: https://www.openstreetmap.org/way/951261501.
Next, I created the same histogram, but limited the data depending to the distance of the ferry ways:
> 30km (only long ferries)
> 1km and < 30km (without short and long ferries)
< 1km (only very short ferries)
We clearly see that based on this data (all ferries with a duration tag) the ferries are faster for longer distances (no surprise, really). Typical speeds seem to be around 5km/h for short ferries < 1km (like river crossings etc.), 15km/h for medium distance between 1km and 30km, and around 30km/h for long distance ferries > 30km. This is roughly in line with the
short/long/unknownSpeedwe use forFerrySpeedCalculator:graphhopper/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java
Line 90 in d7bcfeb
short/longSpeedwhen the duration tag is missing so far...Here is the raw data: https://gist.github.com/easbar/e1ec982d6daa1cf3f58593d58ff78143
Details
Here is the code I used to print the ferry way data: 73e55d4 I added `"com.graphhopper.reader.osm.OSMReader": TRACE` to `logging -> loggers` in `config.yml` to enable the logs, then search/replaced some text to convert it to csv (using ';' as separator) and added a header line with the column names. Then use some python to print the stats, e.g.And here is one of the many examples where our time estimation is off because we apply a too slow speed in case the duration tag is missing (which it is for the majority of all ferries): 17.5h for 108km.
easbar commentedon Mar 10, 2022
Another interesting thing to look at is the number of ferry routes with missing duration tag for each distance:
The bar at the far right shows the number of such ferry routes with a distance >=30km. We see that the majority of ferries without duration tag are short. However, there are also around 8000 medium ones (1km to 30km) (and still around 5000 between 3km and 30km), and around 1600 long ones (>30km). In total these are around 40% of all ferries. Currently they are too slow according to what we saw above. We use the 'unknownSpeed=5km/h' for all of them, but probably 15km/h for the medium ones and 30km/h for the faster ones would be a better fit.
easbar commentedon Mar 14, 2022
I also posted a recent list of all ferries >500km with missing duration tag here: https://forum.openstreetmap.org/viewtopic.php?id=75103