Skip to content

Render cyclist waiting aid side arrow#12374

Merged
tyrasd merged 2 commits into
openstreetmap:developfrom
RudyTheDev:cwa-side-marker
May 26, 2026
Merged

Render cyclist waiting aid side arrow#12374
tyrasd merged 2 commits into
openstreetmap:developfrom
RudyTheDev:cwa-side-marker

Conversation

@RudyTheDev
Copy link
Copy Markdown
Contributor

This PR allows the side arrow to render for cyclist waiting aids when unambiguous, i.e. direction is given:

cwa side cases

This makes mapping the side less confusing, especially since waiting aids use a different meaning of "side".

Original PR where rendering exception occurred #10303. Some relevant side-related comments and discussion at #10128. In short: the proposal used a non-standard meaning of side; it could've been changed, but wasn't; now waiting aids have unique meaning of side.


The comment in code previously implied that it is impossible to determine the side arrow because the proposal's use of side is ambiguous. However, that is not technically correct. The side here means "relative to cyclist" (unlike other features where it is "relative to way"). So it is not ambiguous if the direction of the waiting aid is known. This is basically what this PR implements - if the direction is known, then the side is not ambiguous, therefore the arrow can be rendered. The caveat is to flip it around if the direction=backward. The way's actual direction is ignored/irrelevant.

The code previously also assumed that this wouldn't be ambiguous for one-way ways - but it is actually ambiguous in those cases too (e.g. road with oneway=yes, oneway:bicycle=no and waiting aid in the "opposite" direction). In fact, the code always showed the side arrow based on the way's direction, regardless if the direction was actually set, leading to a case where it would be wrong:

cwa side on oneway wrong

Thankfully, this would only be wrong in that specific rare condition, so I doubt there is any significant number of mistagged features due to this.

I think the intent here was that iD could use way directionality like it does for other features that use side, but that assumption doesn't really work. Like, the meaning of side is not wrong for waiting aids - it's different. Anyway, I removed this way "sidedness" assumption based on the way being one-way. I think it's best that the mapper just specifies direction in those rare cases so nothing has to be assumed. I don't think iD should hard-code (any more) assumptions.

Also, technically the case where side=both is also unambiguous, because direction doesn't matter - it's both sides however you look at it. So I included this case too (although the preset doesn't even show that option). There are apparently cases like that, e.g. example - mapillary. So it will render side=both pretty much always:

cwa both sided

No LLM code used in this one.

@RudyTheDev
Copy link
Copy Markdown
Contributor Author

A bunch of examples around the intersection cycleways: https://pr-12374--ideditor.netlify.app/#map=20.00/52.20125/20.93626

@matkoniecz
Copy link
Copy Markdown
Contributor

at least for me this direction arrow is confusing

is it showing where aid is located? or is showing direction of cyclist that would use it? something else?

@RudyTheDev
Copy link
Copy Markdown
Contributor Author

It's showing both. The preset specifies this:

image

Regardless, this was already implemented before - I didn't change its appearance, only fixed the logic for this case. It's already implemented on all features using side.

image

Copy link
Copy Markdown
Collaborator

@k-yle k-yle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR! I think this is a nice improvement

(although i really regret not fixing the poor tag definition when we realised this issue 2 years ago - now it's way too late)

Comment thread modules/osm/node.js
resolver.parentWays(this).some(way => !way.isOneWayForwards())
this.tags.side !== 'both' &&
this.tags.direction !== 'forward' &&
this.tags.direction !== 'backward'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think of this case? (direction=both + side=right)

  • Is it logically invalid?
  • or does it mean that the handrail in on your right-hand side in both directions? If yes, that would mean that side=right = side=both 😆

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I can see how this can be considered technically logically valid - whichever direction you use, the handrail is always on your right indeed.

But that's not enough information for visuals. Like, there's no way to disambiguate and render combinations of side arrows for two-directional features without additional assumptions. Like, for one, we would have to consider the driving side of the way, which is by the way left-hand side here, so side=right = side=inner or something...

image

This feels like a lot of consideration for a very niche application. Personally, I would just not bother rendering any side arrow stuff for such cases for now. As a mapper, I would be mapping these as 2 nodes.

Comment thread modules/osm/node.js
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In parrallel, I think we should update id-tagging-schema and add a prerequisite tag for the side field:

  "prerequisiteTag": {
    "key": "direction",
    "values": ["forward", "backward"]
  },

This will avoid confusion about the rendering logic, since impossible situations will not be allowed by iD's UI.

this is blocked by openstreetmap/id-tagging-schema#2255

@tyrasd tyrasd added the map-renderer An issue with how things are rendered in the map label May 26, 2026
@tyrasd tyrasd merged commit e4e239f into openstreetmap:develop May 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

map-renderer An issue with how things are rendered in the map

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants