Skip to content

Better handling for missing ferry duration tags #2532

Description

@easbar

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.

Also see here: https://github.com/graphhopper/graphhopper/pull/2528/files#r819521430

Activity

  1. easbar commented on Mar 9, 2022

    @easbar
    MemberAuthor

    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

    image

    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)

    image

    > 1km and < 30km (without short and long ferries)

    image

    < 1km (only very short ferries)

    image

    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:

    ferrySpeedCalc = new FerrySpeedCalculator(speedFactor, maxPossibleSpeed, 30, 20, 5);
    Except we do not use short/longSpeed when 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.
    import pandas as pd
    import matplotlib.pyplot as plt
    import numpy as np
     
    df = pd.read_csv('ferries.txt', sep=';')
    df[df['speed_kmh'].isna()]['distance_km'].clip(0,30).hist(bins=100, range=(0, 30))
    plt.show()

    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.

  2. easbar commented on Mar 10, 2022

    @easbar
    MemberAuthor

    Another interesting thing to look at is the number of ferry routes with missing duration tag for each distance:

    image

    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.

  3. easbar commented on Mar 14, 2022

    @easbar
    MemberAuthor

    I also posted a recent list of all ferries >500km with missing duration tag here: https://forum.openstreetmap.org/viewtopic.php?id=75103

  4. reopened this on Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions