osrm-backend
osrm-backend copied to clipboard
Penalizes roads with 'embedded_rails' for bicycle routes.
#5515
After almost failing on a road with tram tracks i thought that this is a good thing to do.
Hi! Do I understand correctly, that this change will penalize routes with embedded rails when you will move along this route? Why do you want to handle such cases? I think that the main problem to cross such rails neither to move along them.
@gardster I imagine this PR is meant to penalize situations like the image below which exist in cities with trams/street cars. Having ridden my bike quite a lot in a city like this, I'm sort of torn. Certainly, any time you have to cross the tracks it can be a bit sketchy (especially in the wet), and the narrower the angle of your crossing, the worse it is (perpendicular crossing is usually fine, even in the wet).
However, roads like this often have bike lanes too, as they're major thoroughfares. Personally, I wouldn't avoid them, but I can see some people preferring to stay away from the roads with tracks altogether.

@gardster Well, moving along those tracks could be unsafe too. For example here [1] you have to move close to tha tracks in parallel with them and it may happen that your bike wheel will slip into rail and you will fail. Same issue here [2] It's not just europe problem, cause Melbourne have same problem [3]
Therefore penalizing streets with tram rails (and now being equipped with the dedicated bike lanes) will result in probably longer, but safer bike routes. [1] https://www.google.ru/maps/@49.2124499,16.5781748,3a,75y,86.46h,74.91t/data=!3m6!1e1!3m4!1sEOrRoIUAH0x5bAQeHwYKOA!2e0!7i13312!8i6656
[2] https://www.google.ru/maps/@60.1636482,24.9214603,3a,75y,102.78h,71.83t/data=!3m6!1e1!3m4!1sV_nYhj_BvDNY-IpxnSFv4g!2e0!7i13312!8i6656
[3] https://www.google.ru/maps/@-37.8128023,144.9526852,3a,75y,324.93h,55.09t/data=!3m6!1e1!3m4!1sRGkv4rkonufCXBXEpvxGBw!2e0!7i13312!8i6656
As an avid biker in past, having lead hundreds of cyclist over city streets with plenty of tram tracks, I'm strongly against this change. Tram tracks almost always leave space for cycling. Photo [1] is a rare exception — more often falls happen in cases like [3], when a cyclist is breaking traffic law (you should not ever cross the yellow line).
This change also does not account for different rules in different countries: for example, in some you cannot ride a bicycle in any lanes but the first one, and in others road planners care about cyclists and make embedded lanes, like on the photo by danpat.
Basically introducing this penalty does not differ much from introducing a penalty on pedestrian routing for footways that border with cycleways (you have to walk carefully), or a penalty on car routing on streets with embedded rails, since you have to be careful not to ride into a tram car.
(I came here from a link in weeklyOSM. I am an occasional OSRM user mostly via the openstreetmap.org website integration.)
I am a bicycle rider in a city with many stretches of legit dangerous embedded_rails streets: on-street parking and lane widths squeeze cyclists into a death zone between car doors on one side and rails on the other (Mapillary link) and if you are particularly unlucky, the concrete that the rails are set in is broken (Mapillary) and very easy to lose control (another Mapillary).
(Checking now I see that this location also triggered issue #5515 which this aims to address.)
However, some of our (relatively) best bicycle routes also have embedded_rails, but fairly safely separated from the cycleway=track (or an approximation thereof) (Mapillary view). This is actually the best cycle route through the area, and it doesn't make much sense to penalize it.
It might make sense to penalize only the highways with embedded_rails that do not also have cycleway=lane or cycleway=track for the direction in question.
Speakin of case [1]: after falling here in fornt of car i decided to make that change :) That rail configuration is quite popular in Brno and Czech republic. Here is another one example from Praha [4] I agree with @jarek that penalizing all roads with track could be too aggresive change and some additional filtering probably needs to be applied first.
[4] https://www.google.ru/maps/@50.0893978,14.4282223,3a,75y,355.2h,85.89t/data=!3m6!1e1!3m4!1ssycY0izZT8o19ds8djX3vw!2e0!7i13312!8i6656
I think that embedded_rails definitely need to be considered in a city like Toronto, per Jarek's examples above. My commute is made quite treacherous by various tram rails on otherwise reasonable streets.
It seems though like the disagreement in the discussion here stems from applying this rule in a way that is not lane-aware. You could for example have a road with two general traffic lanes in each direction with embedded rails in the middle two lanes. This is very common in Toronto. If the outer lanes are clear, then cycling straight and making right turns is no extra challenge, but left turns from the lane with the tracks can be trouble.
In the examples Jarek gives, the outer lane is used for car parking, often just at certain times of day (e.g. no parking during rush hour in the peak direction), meaning that cyclists will usually try to ride between the two lanes, right down the dashed line. OR, some brave souls will cross the rail to ride in the middle of the tracks... but with impatient drivers coming on from behind, and no safe way to change lanes without slowing down, this is just not a great place to be.
To treat this case properly, we would need to know what lane we are routing the cyclist into. If there are two lanes in a direction and one is used for parking while the other has embedded rails, then we do have a safety issue. We should treat the parking lane as blocked, and the lane with rails as passable but unsafe.
Fortunately, we do have embedded_rails:lanes=*
Are lanes considered at all in the current profile?
Quoting OSM Wiki on embedded_rails:
There are many good reasons for this convention. Nevertheless other traffic should be notified that there is a track, physically, running on the highway. The need for such notification is particularly acute for bicycles, mopeds and other vehicles that have narrow tyres. Railway tracks have deep indentations that narrow wheels can easily and dangerously slip into. This danger alone warrants a note to routing programs so that they can avoid routing e.g. bicycles through such streets.