Permanent ID for OSM

Aus Geoinformation HSR
Version vom 19. Juni 2019, 22:04 Uhr von Stefan (Diskussion | Beiträge) (Die Seite wurde neu angelegt: « This is an '''unofficial proposal for a "permanent ID" (osm_pid) for OpenStreetMap (OSM)'''. See for a m…»)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche
 This is an unofficial proposal for a "permanent ID" (osm_pid) for OpenStreetMap (OSM). 

See for a more official state of discussions.

The goal is to get an opaque fixed length ASCII string. And that are the design considerations:

  • The OSM id alone is not stable enough (as probably most agree); and it can represent many concepts (and that's by design in OSM).
  • The version no. of the object is needed which makes clear which tags are (or have been) referred to.
  • Coordinates are needed, because a change of the way and area geometries does not increment the version number.

So a stable Permanent ID could have the following form (variable length to a maximum of currently 35 chars):



  • N,W,R stands for Node, Way, or Relation.
  • osm_id an unsigned big integer ("digits").
  • version is an unsigned integer with a hash in front.
  • coordinates (lat/lon) are signed floats (always showing the +/- sign), with a maximum of 6 digits. In case of a line (linestring) or an area/relation (polygon) geometries the coordinates taken into account are the lat/lon minimum of the geometry.

Example: "Schloss Kyburg" (Castle Kyburg) has relation 1169711, version #5 at coordinates 47.4584, 8.74343 which becomes following Permanent ID:

 osm_pid = R1169711#5+47.4584+8.74343

Service: In order to be really useful, a service should be implemented, which returns most recent Permanent ID even if an object has been changed (thus having another Permanent ID).

NOTE: Encoding OSM id with type (Node, Way, Relation) as integer (64 bit): osm_id = <node id> × 10 (eg. 123 → 1230), osm_id = (<way id> × 10) + 1 (eg. 123 → 1231), osm_id (<relation id> × 10) + 4 (eg. 123 → 1234). (Source: Mapbox, see [1]). Example: "Schloss Kyburg" is a relation with id 1169711, so it becomes 11697114.