Skip to content

improve surface parser #2751

Closed
Closed

Activity

  1. otbutz commented on Apr 4, 2023

    @otbutz
    Contributor

    These are also missing:

    Pebblestone should probably get it's own value:

    image

    It's used quite a bit and i'm unsure if we should to treat it as impassable or at least avoided terrain for a few transportation types as these rocks might be quite large according to the OSM wiki.

    Pebbles are stones rounded by waves or river flow. Typical size range from 2 to 8 cm.

    That would make them even worse than gravel roads in my opinion.

    Edit: the OSM wiki points out that Surface.GRAVEL might fit:

    As result surface=gravel may refer to road where track ballast from old railway (or crushed stone similar to track ballast) was used, making it tricky or impassable for regular cars and bicycles.

  2. otbutz commented on Apr 4, 2023

    @otbutz
    Contributor

    I'm a little torn on grass pavers. Although they are obviously better than grass, I would still treat them as Surface.GRASS because on the one hand they can be overgrown and on the other hand they have to be treated differently in terms of accessibility.

  3. otbutz commented on Apr 6, 2023

    @otbutz
    Contributor

    @ratrun as these are mostly cycling related, what's your opinion?

  4. ratrun commented on Apr 6, 2023

    @ratrun
    Contributor

    Thanks for pointing me on these planned changes.

    I counted the amount of surface values we currently support and my result is that 15 values are defined in the enum. Would it be possible to utilize a 16th value?
    The reason why I'm asking is because according to the wiki and taginfo we are covering the most important values except for metal and sett. Your proposual is to map metal to PAVED, which I don't think is a good idea. Metal may become very slippery when it is wet and then you cannot treat it like PAVED. The same is true for wood. Therefore I would utilise the 16th value for both of these values and call it 'METAL_OR_WOOD'.

    Or could we spend even 5 bits? In this case we could define the often used sett, wood, metal, and more.

    If not then I agree with your proposual:

    • sett -> COBBLESTONE
    • unhewn_cobblestone -> COBBLESTONE
    • earth -> DIRT
    • pebblestone -> GRAVEL
    • grass_paver -> GRASS
  5. otbutz commented on Apr 6, 2023

    @otbutz
    Contributor

    I didn't change how we interpret most of them. This is the current logic:

    if (surfaceTag.equals("metal"))
    surface = PAVED;
    else if (surfaceTag.equals("sett"))
    surface = COBBLESTONE;
    else if (surfaceTag.equals("wood"))
    surface = UNPAVED;
    else if (surfaceTag.equals("earth"))
    surface = DIRT;

    But I agree that it is probably worth increasing the granularity of our Surface enum. The fact that the average bikespeed parser uses this information is a good indicator that we need this level of detail:

    setSurfaceSpeed("paved", 18);
    setSurfaceSpeed("asphalt", 18);
    setSurfaceSpeed("cobblestone", 8);
    setSurfaceSpeed("cobblestone:flattened", 10);
    setSurfaceSpeed("sett", 10);
    setSurfaceSpeed("concrete", 18);
    setSurfaceSpeed("concrete:lanes", 16);
    setSurfaceSpeed("concrete:plates", 16);
    setSurfaceSpeed("paving_stones", 14);
    setSurfaceSpeed("paving_stones:30", 14);
    setSurfaceSpeed("unpaved", 12);
    setSurfaceSpeed("compacted", 14);
    setSurfaceSpeed("dirt", 10);
    setSurfaceSpeed("earth", 12);
    setSurfaceSpeed("fine_gravel", 18);
    setSurfaceSpeed("grass", 8);
    setSurfaceSpeed("grass_paver", 8);
    setSurfaceSpeed("gravel", 12);
    setSurfaceSpeed("ground", 12);
    setSurfaceSpeed("ice", MIN_SPEED);
    setSurfaceSpeed("metal", 10);
    setSurfaceSpeed("mud", 10);
    setSurfaceSpeed("pebblestone", 14);
    setSurfaceSpeed("salt", PUSHING_SECTION_SPEED);
    setSurfaceSpeed("sand", PUSHING_SECTION_SPEED);
    setSurfaceSpeed("wood", PUSHING_SECTION_SPEED);

  6. otbutz commented on Apr 11, 2023

    @otbutz
    Contributor

    @karussell should we introduce new enum constants or map to existing ones?

  7. karussell commented on Apr 12, 2023

    @karussell
    MemberAuthor

    @otbutz your PR looks good to me too.

    METAL_OR_WOOD

    I would not want to have such a dual value. But I agree with you that metal and especially wood are important and distinct cases where it would be nice if we can include them. And without any problems we should be able to add wood so that we still stay in 4 bits.

  8. otbutz commented on Apr 14, 2023

    @otbutz
    Contributor

    @ratrun @karussell i've updated my PR and added Surface.WOOD

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