What's the best way to batch edits in OSM currently?

What’s the best way to perform small batch edits to OSM data nowadays? I’m talking fixing typos in values and other small QA things, rather than automated edits or imports. So global/regional search > download > edit > upload.

It used to be to do an Overpass query in JOSM and fix from there, but Overpass is just not reliable enough to use in a workflow right now (https://community.openstreetmap.org/t/overpass-api-performance-issues/).

I looked at GeoDesk but I don’t think it can push changes back to the OSM database?

So any other tools a tech-savy but not OSM-developer-level user can use?

I would note that the Automated Edits code of conduct specifically says:

Please be careful with this. Using pure Overpass extracts can result in duplicate features where a mismapped feature was re-mapped by a second user when it didn’t appear on the map or long closed amenities being resurrected when they would previously have been deleted a long time ago.

Perhaps try one of the others? If you’re in the UK, mine should work (albeit slowly, as the server’s busy right now, so increase the JOSM timeout a good bit).

There is the option to update downloaded data (and to download small areas around downloaded data to check for duplication), as well as the JOSM validator. That won’t prevent all potential problems but it will definitely help.

use it to locate places worth investigating using Overpass/Postpass/Geodesk/whatever and load them in JOSM and iD for edits itself?

You need to look at what you are editing if you are not doing automated edit.

With Overpass-Turbo, are you refining your searches as reasonably narrow as you can? Compare a search for highway=residential with highway=residential and type:way in "Dublin City" - the second one is much more like to succeed.


TagInfo is a useful way to pre-sort issues.

For example, I put the word “building” into the search and it gives me all the keys and values that contain the word building: Search results | OpenStreetMap Taginfo Ireland and Northern Ireland

Using this list, I’ve just found the unusual tag building:use:residential = yes and it seems to be on buildings that also have building:use = residential.

If I look at the map: building:use:residential | Keys | OpenStreetMap Taginfo Ireland and Northern Ireland I can see that they are all in the same place, just west of Dublin.

I can then use Overpass-Turbo to search a much smaller area. With the much smaller search (and a longer timeout setting) the chances of my search being successful are much higher.


Separately, if I look at Osmose, it has a page for potential misspellings: Osmose - Information - potential misspelling

Thanks. Yep, conscious of that. For reference, I’m talking about edits such as this one I recently made fixing an obvious issue (copy/paste error) in a sub-key value, as part of this changeset fixing a hundred or so of the exact same issue by the same user. This was after commenting on the original changeset a couple of weeks ago with no response. It was all clear-cut and straight-forward.

Thanks. I had tried the different servers on the OT website but don’t think I had tried all of those listed on that page.

Maybe this is what I’ll have to try and do - the problem is not knowing exactly where the issues are in the first place. I.e., if one spots an issue in Taginfo, it isn’t always possible* to know where those bad values are, so I’d end up using multiple overpass queries to try and figure that out - which I don’t think will solve the fundamental overpass issue?

(*The exception being if the bad values appear in one of the localised taginfo pages)

OK, so if find bad values in Taginfo, search for these using Geodesk, I can load the OSM object IDs into JOSM or iD without needing to run an Overpass query? That could work then.

It is 100% possible with Postpass, that is how Waterway=dam node within waterway=dam line... List of known cases (help welcome!) was created (and it could be probably turned into links opening iD/JOSM directly)

I bet that you have access to OSM object number also in Geodesk, but not verified it

Actually (historically, up until two weeks ago at least**) a ({{bbox}}) query was more likely to succeed quickly than either. The time taken (on the server side) isn’t the area calculation itself, but the “finding whether matches are in the area”.

That said, I completely agree that anything vaguely complicated (that doesn’t need Overpass-only functionality) is always going to be easier in “real SQL” - either Postpass or an actual local SQL database such as you’d get from a Switch2Osm guide. Example:

gis=> select osm_id,ref from planet_osm_line where highway='unclassified' and length(ref)>1 order by length(ref) desc;

which returns something like:

   osm_id   |               ref               
------------+---------------------------------
  835109863 | Hatfield Broad Oak Bridleway 24
 1425695627 | Much Hadham Restricted Byway 60
  229881270 | Much Hadham Restricted Byway 48
  444462465 | Little Hallingbury Footpath 16
  244772766 | Great Hallingbury Footpath 10
 1433641166 | Eastwick & Gilston Footpath 8
  753684968 | Ware Town Restricted Byway 29
    4988368 | Stanstead Abbots Bridleway 19
  753684967 | Ware Town Restricted Byway 29

** I’ve recently upgraded and this query and this one are both <2s at the same server.

Remember: “map what you know.” There is no expectation for anyone to fix the whole planet by themselves. :) Recently, I found a typo locally, and saw on TagInfo that there as maybe 1,000 instances worldwide. All of the other happened to be in Venezuela and from one contributor. Instead of fixing them, I just let the other contributor know about the issue.

I find Postpass to be harder to use, but it definitely has its uses.

Using GeoDesk, there are several techniques that may be useful for this.

What I often use myself is a “map and edit” approach:

gol map usa red: a[building=badvalue] -e

If you just want the IDs:

gol query usa a[building=badvalue] -f list

You can also use -a and -b to narrow the query area to a polygon or bounding box.

If you know Python, you can create far more sophisticated queries. Here’s one that looks for large “houses” in industrial areas that almost certainly are warehouses or other industrial buildings:

from geodesk import *

france = Features("france.gol")
houses = france("a[building=house]").min_area(2000)
	# Houses with a minimum footprint of 2000 square meters

m = Map(link="https://www.osm.org/edit?{osm_type}={id}", color="red")
for area in france("a[landuse=industrial]"):
    for house in houses.within(area):
        m.add(house)
m.show()

This script displays those dubious houses on a map; clicking them takes you straight into iD. You can run it as a regular Python script, or compose it interactively using the GOL Tool itself (instructions).

Downloads / Documentation

P.S. I’m working on an extension to GeoDesk for Python that allows creating automated edits via a script. You’ll be able to create an .osm file with the changes (e.g. replacement of misspelled tags), which you can then load into JOSM for manual review and submission. That would probably be closest to your contemplated “batch edit” approach. I’ll post details in about a month.

please, in such cases make mandatory to link wiki page documenting edit or otherwise try to make user aware of Automated Edits code of conduct - OpenStreetMap Wiki

Yes, absolutely!

In the first phase, I’ll limit the workflow to generating an OSM file with all changes, to encourage users to perform a manual review in JOSM, and upload from there. Only once that capability is mature, I’ll allow users to commit directly to the OSM API.

But in any case, before I’ll release anything, I’ll post a link to the draft documentation to gather feedback from the Community about how to best prevent misuse/abuse.