organicmaps / organicmaps

🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Please donate to support the development!
https://organicmaps.app
Apache License 2.0
8.58k stars 837 forks source link

[routing] Cycling routing: handling of highway=pedestrian #7934

Open patepelo opened 2 weeks ago

patepelo commented 2 weeks ago

In this case OM cycling routing is too inefficient (1.1km vs 500m) in comparison to other routing engines (Valhalla, OSRM) imagen

Example:

https://www.openstreetmap.org/directions?engine=fossgis_valhalla_bicycle&route=41.40096%2C2.15985%3B41.39937%2C2.15735#map=19/41.40058/2.15842 imagen

Looking into map data, it seems that highway=pedestrian will be avoided in OM (https://www.openstreetmap.org/way/936359817)

(latest beta version and map data)

@vng

matkoniecz commented 2 weeks ago

Is https://www.openstreetmap.org/way/936359817 allowing bicycle traffic?

If yes, then bicycle=yes is missing in OSM data.

If no, then avoiding it is entirely reasonable.

patepelo commented 2 weeks ago

Is https://www.openstreetmap.org/way/936359817 allowing bicycle traffic?

If yes, then bicycle=yes is missing in OSM data.

If no, then avoiding it is entirely reasonable.

The wiki:highway=pedestrian is not clear when not defined whether to assume bicycle yes or no in this case.

I would set it up to yes when not defined. The cyclist would have the possibility to push in the case there is a sign explicitly prohibiting.

WDYT?

Misalf-git commented 2 weeks ago

Maybe it's area dependent but a pedestrian literally is a walking person.

In the english wiki I read "mainly or exclusively for pedestrians" ... "for pedestrians to walk" ... "navigated primarily by foot".

matkoniecz commented 2 weeks ago

I would set it up to yes when not defined. The cyclist would have the possibility to push in the case there is a sign explicitly prohibiting. WDYT?

That such routing is a bad idea and if there is no proper data in OSM I would prefer longer trip over chance that I need to dismount

The wiki:highway=pedestrian is not clear when not defined whether to assume bicycle yes or no in this case.

I added hint that it is a good idea to map it.

matkoniecz commented 2 weeks ago

@patepelo have you tried adding bicycle=yes there if cycling is allowed there?

patepelo commented 2 weeks ago

@patepelo have you tried adding bicycle=yes there if cycling is allowed there?

I didn't want to change it to leave it as a study case for this Issue.

As the wiki states, it's not fully exclusive of pedestrian, so there is space for subjectivity on how to interpret for routers. That's why two other routers decided to include them, so it's worth to keep discussing what's best.

patepelo commented 2 weeks ago

P.S. This is the query for the Barcelona example, where bicycle != * (empty)

The majority of that is accessible by bicycle.

https://overpass-turbo.eu/s/1K90

n1ngu commented 2 weeks ago

Unless there is a pedestrian=designated tag I think all ways should be considered implicitly bicycle=yes (except, you know, steps and actual highways).

highway=pedestrian can be generally understood as motor_vehicle=no|destination but I know no pedestrian way in my whereabouts that forbids bikes access. At some times of the day they may be crowded and riding bike may become slow, but not disallowed. If it was disallowed, then map data is missing bicycle=no.

At least the assumption to say "no explicit bicycle tag" --> bicycle=yes|no could be left to user decision so one can configure their bike router to use or avoid those ways.

But avoiding them by default seems very unreasonable to me @matkoniecz

vng commented 2 weeks ago

To clarify, highway=pedestrian are accessible for bicycles, but the algo weight speed is low (2 km/h by default). Spain has NormalPedestrianSpeed for bicycles like 5 km/h

See bicycle_model.cpp

Will check this case.

vng commented 2 weeks ago

The algo takes a longer route, because it prefers bicycle=yes ways over cycleway:both=no (Carrer del Penedès). In short, the calculation speed (weight) for bicycle=yes is more than 2x bigger than cycleway:both=no.

Make sense?

AmyMagdalena commented 2 weeks ago

Adding bicycle=yes to paths that by Spanish law by default allow cycling, is a ridiculous amount of work for one specific routing engine. And just as we don't map for the render, we don't map for the router.

To be clear, the law states you can cycle on paths wider than 3m unless specifically signposted otherwise, anything under 3m would be labelled as sidewalk or footpath and not highway=pedestrian

vng commented 2 weeks ago

No need to add bicycle=yes, unless it is explicitly allowed (by sign for example). Do not map for the router :)

AmyMagdalena commented 2 weeks ago

No need to add bicycle=yes, unless it is explicitly allowed (by sign for example). Do not map for the router :)

Or disallowed.

n1ngu commented 1 week ago

@vng Thanks for looking into it with such detail. I am relieved to know pedestrian streets are taken into account for a bicycle routing and that in this particular case routing through Carrer de Còrsega is a matter of routing weights.

This looks very much like an edge case. All those speed parameters make a lot of sense so this might be a good opportunity to fine tune them.

Fun fact: the whole Barcelona city is notably tilted, sitting in a narrow corridor between a mountain line and a coast line. Not a heavy slope, but local folks develop an instinct to avoid unnecessary NW-SE movements while SW-NE streets are broadly of constant height.

I am explaining this because the current suggested route may look just fine for a flat city but it actually alarmed me because it introduces a significant slope. No cyclist would come up with that route in Barcelona! Yet, we may have never seen this issue if the map was rotated 90º because a similar SW-NE detour would be acceptable so as to use a faster street.

Is street slope taken into account for bicycle/pedestrian routing? Should we turn this issue into an epic? :sweat_smile:

AmyMagdalena commented 1 week ago

@vng Thanks for looking into it with such detail. I am relieved to know pedestrian streets are taken into account for a bicycle routing and that in this particular case routing through Carrer de Còrsega is a matter of routing weights.

This looks very much like an edge case. All those speed parameters make a lot of sense so this might be a good opportunity to fine tune them.

Fun fact: the whole Barcelona city is notably tilted, sitting in a narrow corridor between a mountain line and a coast line. Not a heavy slope, but local folks develop an instinct to avoid unnecessary NW-SE movements while SW-NE streets are broadly of constant height.

I am explaining this because the current suggested route may look just fine for a flat city but it actually alarmed me because it introduces a significant slope. No cyclist would come up with that route in Barcelona! Yet, we may have never seen this issue if the map was rotated 90º because a similar SW-NE detour would be acceptable so as to use a faster street.

Is street slope taken into account for bicycle/pedestrian routing? Should we turn this issue into an epic? 😅

This is true of many cities, when I lived in Canterbury, England, to go home, I'd follow the contour of the hill that no router would ever send me along, cause it was about 500m longer and the terrain was terrible, but I'd get home 5m quicker and a lot less exhausted, upwards gradients really need to be weighted heavily against in cycling routing

vng commented 1 week ago

@AmyMagdalena Routing takes into account elevation. Could you please share your route on EMail, interesting to check how it works.

AmyMagdalena commented 1 week ago

@vng I have sent an email to hello@organicmaps.app about the route in Canterbury, with the recommended organicmaps cycling route, the recommended organicmaps pedestrian route which is close to optimal, and my adjustment to that route that made it speed and energy efficient for cycling, please note I last used this route in the first years of organicmaps's predecessor's existence, it is not a route I can test on the ground for you today as I no longer even live in that country.

Just tested the routers on openstreetmap.org, Bicycle GraphHopper agrees with organic as to the optimal route though calculates the elevation changes different (Organic 44m up 24m down, GH 57m up 28m down), Bicycle OSRM gives an even worse route that's 100m shorter than GH and Organic but seriously, as someone that lived there, OSRM's route is terrible, and Bicycle Valhalla gives the exact route i took