NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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%


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.

permanent link

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

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×290
×22
×2
×1
×1

question asked: 09 Oct '18, 00:19

question was seen: 2,175 times

last updated: 10 Oct '18, 12:56

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum