This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Automating the tally of road lengths added - by username

1

I'm trying to find a way where I can keep track (automated) of the length of roads I add in OSM over time. Is there a script/tool/api that I can use to automatically download the ways (version =1) that I've added into OSM?

I don't want to download from geofabrik and process via osmosis each time, and overpass has a limit of 100 returns.

asked 09 Oct '18, 00:19

markzawi's gravatar image

markzawi
71448
accept rate: 0%


One Answer:

4

There are many different approaches you can take. I'd probably use osmium to convert the downloaded data into OPL format (using osmium cat) in which I can simply filter out all ways edited by a specific user id (simple grep ' u123 ') on the OPL file, then grep ' v1 ' to get the first version. All of this can be done in one command line. You then have to get the nodes for those ways you filtered out osmium getid -r. In the libosmium repository there is a tool call road_length which can do the rest. And while this seems to be a bit complicated at first, after you have used those tools a few times, you will appreciate the enormous flexibility you get from having tools like this that can be put together in different ways to achieve complex ends.

answered 09 Oct '18, 07:01

Jochen%20Topf's gravatar image

Jochen Topf
5.2k55074
accept rate: 31%

Awesome, thank you Jochen! The road_length tool looks promising.

(09 Oct '18, 19:06) markzawi
1

Hmm, actually it is "slightly" more complicated than just getting v1 of the way, as "to do it properly"TM you should add extensions of existing ways added by the user in question and to be really nit-picky new ways created by splits shouldn't be counted :-).

(10 Oct '18, 11:51) SimonPoole ♦

This is OSM, of course it is always more complicated. I am just providing an answer to the original question, not saying that the question is valid. :-)

(10 Oct '18, 12:56) Jochen Topf