2

I am trying to find the code for a query in osmosis that will allow me to download only contributions made by certain OpenStreetMap users. I was thinking to use osmosis to filter out all the contributions made by some friends and I, in order to have some metrics on how many edits we made on OSM for a certain project.

Has anyone done this in osmosis?

I think the code should look something like this in osmosis, however this particular code is not working:

osmosis --rbf in liberia-latest.osm.pbf --nkv keyValueList="username.JohnDoe1" --wx ourcontributions.osm
2

The parameter --node-key-value (--nkv) is for tags, not for users. According to Osmosis/Detailed Usage in the OSM wiki osmosis doesn't have an option for filtering for specific users.

Also keep in mind that a single object can be edited by multiple users, but a .osm file usually only contains the last user who edited the object. For obtaining the user who original created of the object or for obtaining all intermediate users you will have to look at each individual version or get a full history dump.

Alternatively you can also try to use Overpass API but likewise it only supports the last user who touched the object.

2

I had the same desire to get all changed by a specific user. This question popped up quite high in the search results so I want to answer it despite its age in the hope others find the information useful.

Osmosis can't do the job as others already mentioned. Here is a working way.

First we need an input file containing all changes, as the user in question might no longer be the current "last modifier". The change might have even been deleted in the meantime.

I was interested in only a short period of time, so I combined multiple osc files with the help of osmupdate it fetched from planet.openstreetmap.org. You could also use osmium-tool with the time-filter command to extract a time-frame from a full history planet dump.

osmupdate 2016-12-03T00:00:00Z changes.osc

Then I used osmfilter to only keep modifications by a user I identified by user ID. I used the user ID and not the user name because it is possible that users change names.

osmfilter changes.osc --keep="@uid=12345" -o=filtered_by_user.osc

The resulting .osc file is a diff of all modifications done by the specified user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.