From time to time, I need to know the highest node, way and relation IDs which currently occur in the OSM database. There are several services that let me look up the number of elements (such as OSMstats), but due to deleted elements, this number is necessarily smaller than the maximum ID.

So far, I've researched this info manually by looking at recent changesets, and of course I could do it by downloading the latest planet or diffs, but surely there's some more convenient solution?

asked 07 Jun '20, 13:31

Tordanik's gravatar image

Tordanik
11.7k14103145
accept rate: 34%


You can find the latest maximum element IDs again on the mentioned OSMstats page. It should be updated within 15min.

permanent link

answered 18 Dec '20, 15:57

pascal_n's gravatar image

pascal_n
18635
accept rate: 14%

Very handy feature, thank you! :)

(18 Dec '20, 16:25) Tordanik

How "current" should the information be? I'm asking because I believe that instantaneous things are a bit fuzzy due to the way ids are allocated (fuzzy as in that short term the ids don't monotonously increase with time). I'm not sure why you believe that deleted elements would be particularly relevant, we are deleting elements at roughly a rate of 0.5% of the rate we create them at, so any effect on the the current max id is going to be miniscule.

tl;dr version if day granularity is enough I would have suggested simply to use Pascals site, except: he doesn't actually provide the number any more, so I suppose somebody that runs a database syncing via diffs needs to offer such a service (which will naturally be off by a bit).

Yes: not an answer.

permanent link

answered 08 Jun '20, 22:38

SimonPoole's gravatar image

SimonPoole ♦
43.1k13315679
accept rate: 19%

edited 08 Jun '20, 22:38

Comparing the latest numbers from the graph on Pascal's site (6 billion nodes) with the current max id (7.6 billion), the difference isn't huge, but quite noticeable.

The numbers don't need to be particularly current; for my use case I can easily just add a few percent of buffer, which makes monthly data certainly good enough.

(Incidentally, the use case is getting MapSplit to work on the whole planet. At that scale, a huge ID-indexed array is a very compact and dense data structure for storing info on nodes. So you can hopefully expect some related pull requests once it's done :)).

(11 Jun '20, 21:32) Tordanik
Your answer
toggle preview

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:

×18
×9

question asked: 07 Jun '20, 13:31

question was seen: 1,384 times

last updated: 18 Dec '20, 16:25

powered by OSQA