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

Are node ids unique in the planet osm data?

1

Are node ids unique in the planet osm data? If not, are they unique for a geography such as country?

When a node is added to a way, does that change the osm_id of the remaining nodes?

asked 11 Jul '19, 20:02

Maneesh's gravatar image

Maneesh
26224
accept rate: 0%


2 Answers:

3

Node IDs are indeed unique.

Note however that node IDs, way IDs and relation IDs are separate spaces, so node 537, way 537 and relation 537 can co-exist.

answered 11 Jul '19, 20:31

Richard's gravatar image

Richard ♦
30.9k44279412
accept rate: 18%

2

Answering your second question, no, object IDs aren't dynamic. An existing object (be it a node, way or relation) will keep the same ID unless it gets deleted and recreated as a new object.

Object IDs aren't necessarily static, though. Like I said above, someone could delete an OSM object and create a new object representing the same real-world item, which would now have a different ID. If you're wondering if you can use the OSM ID to refer to a POI, the answer is that this may work in the short term, but it isn't guaranteed to always work because someone could change the data at any point.

answered 11 Jul '19, 22:42

alester's gravatar image

alester
6.6k266100
accept rate: 28%

Source code available on GitHub .