abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
495 stars 118 forks source link

Node on a road "highway=crossing" "bicycle=no" #265

Open Stapawe opened 4 years ago

Stapawe commented 4 years ago

Part of crossings is mapped this way but it add a penalty for bikers cycling on the road. I think this should be ditched during preparing OSM data.

polyscias commented 4 years ago

I think the openstreetmap data is wrong here and that should be corrected.

Either place a note on the map, edit openstreetmap yourself, or share the location in this issue.

Stapawe commented 4 years ago

There are 10 k with bicycle=no and 8 k bicycle=dismount https://taginfo.openstreetmap.org/tags/highway=crossing#combinations. I think a program should be idiot-proof.

abrensch commented 4 years ago

I see, it's really a significant problem;

https://overpass-turbo.eu/s/X7q

But that should go into the profile logic. Modifying data during preprocessing is never a good idea

(however, I'm doing that e.g. for bicylce routes over motorroads, )

polyscias commented 4 years ago

This kind of problem can never be completely prevented, but agreed there are likely quite some instances where this is not correct. How about updating the openstreet wiki to mention this. Would also be good to add this to one of more of the Error detection tools.

Stapawe commented 4 years ago

I added to wiki ,,Do not use {{Tag|bicycle||''no''}}, because it blocks the road for bicycles." but... https://wiki.openstreetmap.org/w/index.php?title=Tag:highway%3Dcrossing&diff=2016151&oldid=2016150 . I can't imagine correct (useful) instances when cycling on a road is allowed but not keeping on across a crossing.

matkoniecz commented 4 years ago

Using highway=crossing bicycle=no to express "you must not cross road here while cycling, but cycling on road is not affected" is standard OSM tagging.

Note also that in case of mapping sidewalks/cycleway as road property (rather than as a separate geometries) there is no other way to express that.

@polyscias

I think the openstreetmap data is wrong here and that should be corrected.

This is standard way of tagging that. I understand that it is tricky to handle but declaring it as "incorrect tagging" and is not helpful.

poutnikl commented 4 years ago

@polyscias @abrensch @matkoniecz @Stapawe There is a way how to use penalty for highway=crossing node conditionally, only for going along smaller OSM ways. It may not be 100% correct for all scenarios but I guess it should generally work.

A Brouter profile author can refer to the profile way context variables within the profile node context via way:variable, as can be seen in BRouter profile development guide

I use in my bike profiles the way context variables

assign ismainroad highway=motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified

assign hascycleway = not and ( or cycleway= cycleway=no|none ) and ( or cycleway:left= cycleway:left=no ) ( or cycleway:right= cycleway:right=no )

For the crossing penalty logic, it could be defined a way context variable marking no-penalty candidates ( e.g. "bigger roads" without cycleway feature ) for cases a node highway=crossing bicycle=no|dismount occurs on them:

assign noCrossingPenalty = and not hascycleway ( or ismainroad highway=residential|living_street|service )

It can be referred in the node context like this:

assign HasCrossingPenalty = if ( and highway=crossing bicycle=no|dismount ) then not way:noCrossingPenalty else false

or

assign initialcost =  
                 <conditional cost expressions>    
                 else if highway=crossing then (    
                       if ( and bicycle=no|dismount not way:noCrossingPenalty  )     
                                then <crossingpenalty_initialcost>     
                                else <crossing_penaltyless_initialcost>        
                      )    
                 else 
                     <conditional cost expressions>

or

assign bikeaccess =  
                 <conditional access expressions>    
                 else if highway=crossing then (  or not bicycle=no|dismount way:noCrossingPenalty  )
                 else 
                     <conditional access expressions>
matkoniecz commented 4 years ago

It may not be 100% correct for all scenarios but I guess it should generally work

Yes, it should solve 99,9%+ of highway=crossing bicycle=no cases (at this moment I cannot imagine correctly tagged case where it would not work).

poutnikl commented 4 years ago

@matkoniecz By perhaps less than 100%, I had in mind the optimal content of noCrossingPenalty, avoiding false positives ( keeping penalty when it should not ) and false negatives ( removing penalty when it should not ). Generally, optimal solution is usually kind of trade off between both criteria. I just guess the chosen selection should be a good choice. Most of this can be addressed by refining of the noCrossingPenalty expression logic in the updated previous post.

poutnikl commented 4 years ago

If you check “highway=crossing AND bicycle=no in Brno” ( my Home city ) on overpass-turbo, you will notice that there is one highway=cycleway in the City of Brno with a high level of craziness : :-) $Screenshot_20200905-21:31:06

polyscias commented 4 years ago

There has been a long discussion going on on Openstreetmap, see highway=crossing with bicycle=no and my conclusion based on the Short summary that this is wrong or unnecessary tagging.

For brouter a work-around is simple, just completely ignore bicycle=no on crossings.

matkoniecz commented 4 years ago

my conclusion based on the Short summary that this is wrong or unnecessary tagging.

1) I understand that you disagree with such tagging and prefer alternative, this does not make it wrong 2) it is widely used 3) in some cases it is necessary to have this tagging tool. For example in case of a road with cycleway:both=track (tagged as cycleway(:*) tag, not as a separate cycleway), with crossing between two sides of road that requires cyclists to dismount while crossing the road

poutnikl commented 4 years ago

Another case is an independent highway=cycleway along a city streets, where highway=crossing bicycle=no is set on the cycleway crossing the perpendicular streets. ( as in my previous post ).

Well, formally, the cycleway is always interrupted by those crossings, but a rider perceives it as a single cycleway with a serie of stupid dismount requests.

polyscias commented 4 years ago

Had a look on the crossings in Brno and they all are wrong (a cycleway crossing a street) or unnecessary (a footway crossing the road, because of the footway you already have to unmount)

widely used was already discussed on Openstreetmap and I have nothing to add to what is written there only the suggestion to have a look in Error detection tools for your area and get a better feeling for typical problem ratio's, I like Osmose and would be nice to add a check on this problem there.

@matkoniecz: please come up with real-life examples, I can assure you that less than 1% of the current cases are what you describe in point 3 and I think close to None, but I leave that for you to prove. Off-coarse this can be solved by mapping the cycleways separately.

poutnikl commented 4 years ago

Had a look on the crossings in Brno and they all are wrong (a cycleway crossing a street) or unnecessary (a footway crossing the road, because of the footway you already have to unmount)

I am not sure about that.
Undesired ? Yes.
Is the cycleway designed horribly ? Yes !!
But the cycleway is not formally crossing the street. So in some way, it is unnecessary. But effectively it is the some, bicycle is not allowed. And yes, bikers do not bother to dismount. I do not remember if there is a dismount sign or not.

Note that there are ongoing debates about interpretation of the Czech traffic law, if it is implicit forbidden or not to pass the crossing on bike, if there is no explicit dismount traffic sign.

polyscias commented 4 years ago

But the cycleway is not formally crossing the street.

Like I said, I did have a look in the openstreetmap data using JOSM and it looks to me it is carefully mapped apart from the bicycle=no on the highway=crossing nodes, for example:

Screenshot_20200906_190420Screenshot_20200906_190521

So before the crossing the cyclepath becomes a footway with (in this case) bicycle=yes. I really can not image one reason then to have bicycle=no on the crossing node.

There is also a crossing where the footway does not have bicycle=yes and then bicycle=no on the crossing node is not wrong but unnecessary, as the footway should already have made the cylist unmount.

One observation is that these paths and crossings are part of a cycle route and AFAIK brouter will assume all ways part of a cycle route are fine.

poutnikl commented 4 years ago

It may all depend on the local interpretation of traffic law in context of riding bicycle along crossing without explicit dismount signs or dual feet/bike crossing, if the arrival to the crossing is otherwise allowed.

Majority interpretation here is that it is not allowed. In other countries it may be allowed. So how to mark it ? Note that being a cycle route cannot take precedence over the traffic law.

Note that aside of the interrupted cycleway, there is AFAIK no explicit terrain marking of this cycle route. Most of the routes within Brno is incorrectly mapped in OSM as regional or local routes, but without terrain marking, being effectively just recommended routes.

polyscias commented 4 years ago

Yes, understood that things depend on local traffic law, but suppose it was not allowed to cross the street cylcing, then it is just a matter of removing "bicycle=yes" for the footway. Note that for a complete picture it also also important to know what are the access rights on the "yellow roads".

The whole point I am making is that everything is much better done by setting the access rights on the ways crossing correct and if done, there is no need for access rights on the crossing.

What I wrote about a cycle route taking precedence bicycle restrictions are these lines of the trekking profile:

assign nodeaccessgranted =
     if any_cycleroute then true
     else lcn=yes

assign isbike = or bicycle_road=yes or bicycle=yes or or bicycle=permissive bicycle=designated lcn=yes

And that does makes at least some sense looking at Way access mismatch relation route=bicycle

poutnikl commented 4 years ago

About the proper access marking for highway=*, you might be right, but it is IMHO easier to assign an attribute to the crossing then to create an extra way, which may lead to trigerring an initialcost anyway.

As @matkoniecz mentined, how to manage cases highway= AND ( cycleway= or (sidewalk= and bicycle=yes)) or similar, with forbidden crossing ? In OSM and in routing. Yes, there could be still created segments alternating cycleway= with footway= or sidewalk= and bicycle=no, but it seems to be complicated.

Should we in routing consider no bicycle crossing to set extra route cost, or should we ignore it as at cycleroutes ? Many users explicitly demand to get routes without dismount requirements, as they do not consider bike pushing as a bike transportation mode.

polyscias commented 4 years ago

but it is IMHO easier to assign an attribute to the crossing then to create an extra way

I think you make the classical error that also others make and which took me some time to realize.

Given the crossing in the picture above, you are allowed to cycle over all yellow/residential roads, so what happens if I come from the North (Botanická) and want to go to the East (Zahradníkova)? Two options, you begin on the cyclepath and then go right onto the residential road or you start on the residential road (there is nothing preventing that) and take a left.

In both cases you cross the highway=crossing + bicycle=no node so you have to dismount or do you tell me the "local interpretation of traffic law" tells you have to dismount in this case. ;-)

The case @matkoniecz mentioned with a sidewalk has exactly the same problem, on these roads you can go straight without dismounting, if that is not the case, bicycle=no is not needed

Some question you should ask yourself:

Should we in routing consider no bicycle crossing to set extra route cost, or should we ignore it as at cycleroutes ? Many users explicitly demand to get routes without dismount requirements, as they do not consider bike pushing as a bike transportation mode.

You could trust what I wrote earlier:

For brouter a work-around is simple, just completely ignore bicycle=no on crossings.

But if you do not want to do that, download at least 20 nodes with highway=crossing + bicycle=no, study them using the three questions above and if you find one that is "valid and needed" post them. "Valid and needed" means that without "bicycle=no" the route was incorrect and by only adding "bicycle=no" to the crossing the route became correct without impacting other valid routes.

I did so and you will find no nodes with highway=crossing + bicycle=no apart from some unneeded cases (footway crossing road where you are no allowed to cycle) in my country

poutnikl commented 4 years ago

Lets say bicycle=no is in the highway=crossing context anisotropic. :-). And it can be bicycle=no foot=yes, or bicycle=yes foot=no, or bicycle=yes foot=yes

Cars are not supposed to go along crossing, bicycles possibly are. Crossing is usually dedicated to pedestrians, so foot=no would make sense only if it was a bicycle only crossing on a bicycle onle ways. ( Another case is dicouraged crossing =no for cancelled=forbidden crossing).

Proper routing should be able to deal even with improper mapping to make some relaxed conclusion. It is possible bicycle=no is the last stop able to tell the router riding bicycle is not possible stops, if the bicycle friendly mapping is otherwise uninterrupted. A profile author cannot be expected to go and fix all errorneous mapping, affecting its profile, related to crossing or not.

You still have not addressed cycleway=* scenarios, where a parallel way cannot be marked as bicycle=no near the crossing, as there is formally no such a way.

matkoniecz commented 4 years ago

in my country

At least specify country of you are going to test on a biased samples.

And examples were provided to you already.

polyscias commented 4 years ago

@matkoniecz: Do you agree with @poutnikl that you can add motor_vehicle=no to crossings that according to you are correctly mapped with bicycle=no?

I have checked the nodes you can find with the link @abrensch shared earlier, https://overpass-turbo.eu/s/X7q and more in the Ruhrgebiet.

And examples were provided to you already.

Please be more specific.

matkoniecz commented 4 years ago

Do you agree with @poutnikl that you can add motor_vehicle=no to crossings that according to you are correctly mapped with bicycle=no?

Why you would want to do this? Is there some case where you may use some motor vehicles on cycleways in addition to bicycles?

It sounds as useful as adding bicycle=no highway=crossing in case where footway is not allowing bicycle traffic anyway (=not useful at all)

So answer is probably that I disagree but maybe I am missing some detail.

poutnikl commented 4 years ago

@polyscias I do not understand why are you referring to me to be agreed with, as I have not said that. You could as well add motor_vehicles=no to stairs. Neither would make sense as redundant, as motor vehicles do not go along stairs nor along crossings. Bicycles do go along some crossings.

polyscias commented 4 years ago

@matkoniecz: thanks, convoluted answer that goes for me like unnecessary (I take that as yes), but probably no.

@poutnikl:

I do not understand why are you referring to me to be agreed with, as I have not said that

I concluded that based on what you wrote "Cars are not supposed to go along crossing", am I missing something? If so, I am sorry.

To make it even simpler, let's take the simple crossing from openstreetmap Typical crossing

Between A and B is a highway=footway, no cycling and driving allowed Between C and D is a highway=secondary, cycling and driving allowed

On the crossing is highway=crossing, bicycle=no and motor_vehicle=no Two questions: 1) Can a person cycle from C to D (no dismounting), yes or no 2) Can a person drive a car (normal) from C to D, yes or no

My answers: 1) no, 2) no.

Please do the discussion a favor and make a clear choice. Anything from a plain yes or no, things like unnecessary, dismount, not allowed but nobody cares, redundant, walking, etc is yes.

poutnikl commented 4 years ago

My answer until now has been 1) yes 2) yes.

But I see my interpretation differs from what OSM wiki says. There is written there should be the only explicit values yes, not to block access completely. I feel now that I should respect it and to say no and no. The question remains how to interpret default crossing values, if it should be implied from the crossing related way tags or if to take it as a hard bicycle=no. I suppose the former.

Said that, I also think once existing highway=crossing bicycle=no should not be ignored in the along crossing context, as it is perhaps discouraged and wrong way to mark the bicycle access as denied.

I have to also add I disagree with OSM wiki interpretation, as I consider crossings as an anisotropic, direction specific, context dependent feature. As I have said earlier by other words, motor vehicles have implicitly and generally denied access to go along crossings, but all vehicles have implicitly allowed access to go across crossings. Implicit access for bicycles along crossing is undefined ( as their can be both allowed or denied). So highway=crossing motor_vehicle=no does not make sense, as it is already in place implicitly. OTOH, highway=crossing bicycle=no does make sense, as it defines the particular explicit access value.

One can consider the approach all could be defined at OSM way level. But then the crossing node access tags are redundant and should be avoided.

We have not still touched cases of highway= cycleway= or similar.

matkoniecz commented 4 years ago

On the crossing is highway=crossing, bicycle=no and motor_vehicle=no

AFAIK motor_vehicle=no part is basically not used and therefore not worth considering.

Version with just bicycle=no is actually used in mapping and therefore worth considering.

polyscias commented 4 years ago

@matkoniecz: You did make a choice not to answer the two questions.

@poutnikl: I understand your reasoning, good write up. Yes real world crossings are an-isotropic but OSM access rights for nodes not. bicycle=no on a highway=crossing means the same thing as bicycle=no on a barrier=gate or on a way marked with bicycle=no.

To keep this at least a bit a brouter-specific issue, note that for routing you would need to evaluate the crossing in the context of "into" and "out of" the crossing. If I come into the crossing using a footway and go out of the crossing using a footway I can ignore "bicycle=no", but if I come in from the secondary road and go out via the secondary road then "bicycle=no" should be taken into account. One value "bicycle=no" is then also not enough because what if you come into via come in via a footway and exit via the secondary road etc. etc.

If you want this kind of "fancy" behavior there are Turn restrictions.

Note that brouter does handle turn restrictions separately, in the profile with node and way support it is not supported. brouter can only handle in node context the way into (or is it out-of?) the crossing and even that is not use in the default trekking profile.

So things are simple and for more fancy things you need relations. I am sure this is also the best solution as no or almost no foot or bicycle crossing needs this kind of special handling.

If you still like to have a discussion on highway=crossing + cycleway=*, can you describe a as simple as possible use-case like I did with the simple crossing above?

poutnikl commented 4 years ago

@polyscias I understand in high level, how are turn restrictions implemented in BRouter. I would not go so far for crossings. I understand the eventual directional logic described above exactly the opposite way to you. Secondary roads do no go along crossings, so there would be always YES, on the other hand I would not ignore NO on footways or similar. I guess we can agree the crossing access should be expressed rather in the way context, where the directionality is implicitly involved.

To focus on earlier mentioned cases, where bicycle friendly way is a feature of the main road, like highway=secondary cycleway=track :

1/ what is optimal OSM mapping to express enabled/disabled bicycle access for crossings ? 2/ what are existing OSM mappings of that, good, discouraged or just wrong, for BRouter profile to deal with them? 3/ is cycleway=crossing applicable to featured roads as well, or just for dedicated highway=cycleway ? ( my understanding is the latter ) 4/ What is the way to keep Brouter to think the road is passable, if the cycleway feature is interrupted somehow by mapped denied access along the crossing ? 5/ Scenario may or may not be extended by sidewalk or footway road feature. 6/ I am aware the default BRouter profiles and mine as well use a relaxed approach to deal with local accessibility, what is generally good thing. But, OTOH, some users demand guaranties of "on-the-bicycle" transportation only, being able to avoid being forced to dismount. So there is demand for some flag for relaxed versus strict bicycle access.

                                      E
                                      |
A-------------------------------------X-------------------------------------B
                                      |
C.....................................Y.....................................D
                                      |
                                      F

Legend:

matkoniecz commented 4 years ago

If Y crossing is location where cyclist going C-D is obligated to dismount and cyclist going E-F is not obligated to dismount and cycleway is mapped using cycleway*=track...

Then highway=crossing bicycle=no is common way to tag this. Note that splitting A-B road and removing cycleway*=track around Y would not solve problem, this would describe situation where cycleway merges into road. Maybe tagging that section as bicycle=no would work? (even if it would work then highway=crossing bicycle=no is still valid and used tagging method)

poutnikl commented 4 years ago

I know highway=crossing bicycle=no is the common way. By strictly speaking not semantically, but in OSM mapping logic context, it applies rather on the main road than the cycleway feature. I was thinking about the way context ways to do so.

polyscias commented 4 years ago

I know highway=crossing bicycle=no is the common way.

No, it is not, or are cycle routes that go over ways where you are not allowed to cycle also normal? Notice that last problem is an estimated factor 15 larger than this.

I understand in high level, how are turn restrictions implemented in BRouter. I would not go so far for crossings.

Do you understand that your "anisotropic interpretation" is like turn restrictions and therefore currently not implemented in brouter and very likely also not in other routers?

To repeat: OSM node access is evaluated in node context.

1/ what is optimal OSM mapping to express enabled/disabled bicycle access for crossings ? 2/ what are existing OSM mappings of that, good, discouraged or just wrong, for BRouter profile to deal with them? 4/ What is the way to keep Brouter to think the road is passable, if the cycleway feature is interrupted somehow by mapped denied access along the crossing ?

Look at the simple crossing, as long it is highway=footway bicycle access is disabled, make it a highway=cycleway (or add bicycle=yes to the road) and bicycle access is enabled. Nothing special needed.

3/ is cycleway=crossing applicable to featured roads as well, or just for dedicated highway=cycleway ?

See Tag:cycleway=crossing.

The drawing you made is misleading for me, in OSM A-B and C-D are not two ways but one way, so I took an American crossing and implemented what you want:

Screenshot_20200916_154321

Notice that this is pretty exactly implementing the real crossing, the cycle tracks (the purple bars along the way) end at the crossing and the next part is marked with bicycle=dismount (that is the green cycle symbol). Routers can now even make a better estimate by taking the length of the crossing and reducing the speed to 5 km/h.

Note that having to dismount as cyclist (apart from yielding) on a crossing is not normal, so do not be surprised some special handling is needed like above. For even more fancy things you will need to map the cycleway and footways as separate ways and looking at the usage of cycleway=crossing that is significantly more use than the amount of errors on highway=crossing + bicycle=no.

poutnikl commented 4 years ago

You seem like having bad sleeping today. You have misinterpreted and overreacted to most parts of my post.

polyscias commented 4 years ago

Reading the first paragraph of your post your position was not very clear to me. Re-reading, the begin and end are clear but the part between "I understand" and "on footways or similar" not. Is it an overreaction? Yes, likely, I take my time to compose a reply.