How to detect if the oneway tag direction has changed?

In our organised editing activity, we have recently noticed an error occasionally creeping in where a way accidentally gets its direction reversed. We believe this is related to the V keyboard shortcut in the iD editor, likely when a mapper is doing a copy and paste action without having the right focus, so an unnoticed “Reversed a line” occurs.
Our activity includes a review process for every changeset, but this specific error surprised us because no tag values change when a way is reversed. You can see an example in this changeset where I changed the oneway direction for a single way as a fix, yet there is no obvious data change shown. For example, OSMCha shows no data difference. The way does appear in the “Geometry changes” section, but that can also happen when a split occurs on the way. The oneway value just remained as yes.

So my question is this. Even though we will try to prevent this mistake in the first place, now that we are aware of it, how can we reliably catch way reversals when reviewing a changeset?

When ways are reversed, the only thing that changes is the order of their nodes.
See as an example way/208358550. In version 1, its first node is node/160881298, and its last node is node/2186588626. In version 2, this order is reversed.

1 Like

Besides how to detect the reversion of a way, I don’t think there is a way to detect whether it has happened not on purpose.

A way could also be a closed way. So it’s a bit more complex than comparing first and last node.:wink:

On exploring further, we realized that the iD editor shows a message in the bottom left corner, “Reversed a line”, but only for a few seconds, and that seems to be the only direct notice of the reversal.
I have made sure the team is now careful about this case. However, the change has very limited visibility. Because of how it is stored, it is not clearly listed as a change. Map tiles also render with a delay, so a way direction reversal may not be noticed during review either.

The Better OSM browser extension has a flag for this ⓘ The line has been reversed

1 Like

@Kovoschiz That’s great.
Here’s how it looks for the example changeset from my original post.

It would be helpful if there were a way to flag reversed one way streets in OSMCha.

2 Likes

The problem is that there are two distinct cases that you need to handle in an editor (BTW I was discussing this with the iD maintainer at the recent Karlsruhe hackweekend):

  • the user deliberately reverses the way direction manually. If the way is a highway with a oneway tag (that is oneway=yes/1/true/-1 but not oneway=no/false), both iD and Vespucci assume the reason the user is doing this is to actually reverse the oneway direction and doesn’t change the tagging.
  • the user is reversing the way direction indirectly for example by merging two highways. I don’t know what iD does then, but Vespucci changes the tagging to keep the oneway direction constant (for example from oneway=yes to oneway=-1) if it has to reverse one of the two ways. Naturally the editor has to check if this is even possible without conflicting with other tags on the ways.

The accidental reversing falls in the former category and that is why the tagging isn’t changing.

We also looked for a way to disable keyboard shortcuts in the iD editor, since that would prevent accidental changes like this. However, it does not seem that such an option exists.