How to clean up OSM after Organic Maps outdoor_seating=no bug?

The August release of Organic Maps had a bug that resulted in outdoor_seating=no being added to almost all objects touched by the build in editor (see: outdoor_seating=no is added to all POIs by the editor · Issue #9049 · organicmaps/organicmaps · GitHub).

The bug is fixed in the code, but I have no Idea how to clean up the damage in the OSM database. Does anyone know if there is some way or some tool that can be used to remove all outdoor_seating=no tags that were added with Organic Maps?

7 Likes

Ouch

And that would not be a one time fix either, as not all users upgrade…

Would it be possible to blacklist a particular version?

I would expect Organic Maps maintainers (or someone willing to do it for them) to use changeset listing from https://planet.osm.org/ to identify edits made with broken versions, automatically check object history and identify where bad tag was added with bugged version - and then remove invalid tag in this cases.

4 Likes

To identify those, you need to look at the tags on the changesets that added the outdoor_seating=no tag.

The planet files don’t contain the full object history, just the present state of objects. There are also dumps with the full history but I haven’t worked with them, so I am not sure if that’s a feasible approach.

An alternative is to identify all objects with outdoor_seating=no with Overpass, then use the API to retrieve the object history for each object, and the changeset tags for each changeset.

1 Like

See the sql on the github issue.

Ok, I had hoped there was an easier solution for this.

In hindsight I should have pushed more for an OM hotfix update.

It’s less of a problem than many OSM data issues - adding an irrelevant attribute tag (especially a negative one) isn’t likely to mislead data consumers. Compared to (real example) “adding all objects with a latitude of 4.0” it’s a very minor issue - you wouldn’t want to revert the data, just tidy it a bit.

1 Like

in theory some of them may be added to place that have indoor seating (but it is not the most crucial property)

1 Like

As a personal data consumer of the outdoor_seating tag, I am glad this is getting some attention and cleanup. An unfortunate bug for sure.

Is someone working on cleaning it up? I would think it’s the responsibility of the developers of Organic Maps to do so?

Thinking some more about how this could be done…

So you have an SQL database where you’ve identified the affected changesets?
Then I guess from that database, you could export the affected changeset IDs, instead of just doing a count(*), correct?
Does your SQL database also tell you the object IDs that were touched in each changeset?
If so, you could do a join to export the list of object IDs, correct?

That would be even better than a list of changesets, because once we have a list of object IDs, from what I can see, it’s then just a matter of going through those and removing the outdoor_seating=no tag?

Yes - see here.

Alas no - just the changeset and discussion details.

I’d suggest also doing some sanity checking of the data, to check the assumptions that the versions in the github issue are indeed affected, and are the only ones affected. An example changeset download is here - it’s easy to convert a list of changesets ids into a script to download them. Be mindful of rate limiting, though.

You also may wish to consider “objects that had outdoor_seating set by a previous editor”, but that’s more complicated. Also, much of the advice from Automated Edits code of conduct - OpenStreetMap Wiki applies, such as “be cautious” and “document and discuss”.

Since Organic Maps issues were moved from Github to another git hoster (through no fault of theirs) this issue now appears to be at https://git.omaps.dev/organicmaps/organicmaps/issues/9049.

3 Likes