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 |
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. answered 08 Jun '20, 22:38 SimonPoole ♦ 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
|