Permanent ID for OSM: Unterschied zwischen den Versionen

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
K (OSM Permanent ID Service)
Zeile 3: Zeile 3:
  
 
=== Goals and Requirements ===
 
=== Goals and Requirements ===
The goal is to get an opaque (eventually fixed) length ASCII string.  
+
 
 +
The goal is to get an opaque (eventually fixed) length ASCII string for an OSM id.  
  
 
That are the design considerations:
 
That are the design considerations:
Zeile 9: Zeile 10:
 
* The version no. of the object is needed which makes clear which tags are (or have been) referred to.
 
* 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.
 
* Coordinates are needed, because a change of the way and area geometries does not increment the version number.
 +
 +
=== Status of OSM id ===
 +
 +
One can use OSM id nevertheless (at own risk)! Many variants are known:
 +
 +
'''As is with OSM id (bigint)''' and a code for Node, Way, Relation in front.
 +
Currently many applications depend on plain osm_id, eventually preceeded by node,way,relation (or N/W/R), like theses web applications:
 +
* The main OSM web page: Example Denner Hombrechtikon https://www.openstreetmap.org/node/6313169265
 +
* Qwant Maps: Example Denner Hombrechtikon https://www.qwant.com/maps/place/osm:node:6313169265@Denner#map=18.00/47.2519793/8.7681836
 +
* Castle Map: Example Schloss Rapperswil https://castle-map.infs.ch/#46.805,8.205,8z,W417258377
 +
 +
Another usage of osm_id is to convert it to a '''single big integer''': It's possible to encode the type (Node, Way, Relation) into the OSM id as a single 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 [https://docs.mapbox.com/vector-tiles/reference/mapbox-streets-v8/#openstreetmap-ids]). Example: "Schloss Kyburg" is a relation with id 1169711, so it becomes 11697114.
 +
 +
  osm_id*10  -- Node
 +
  osm_id*10+4 -- Relation
 +
  osm_id*10+1 -- Way
 +
  
 
=== Format ===
 
=== Format ===
Zeile 34: Zeile 52:
 
   See https://wiki.openstreetmap.org/wiki/Permanent_ID for a more official state of discussions.  
 
   See https://wiki.openstreetmap.org/wiki/Permanent_ID for a more official state of discussions.  
  
'''Use OSM id nevertheless (at own risk)''': ...as is with two fields type (Node, Way, Relation) and osm_id (bigint)... or as a '''single big integer'''. It's possible to encode the type (Node, Way, Relation) into the OSM id as a single 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 [https://docs.mapbox.com/vector-tiles/reference/mapbox-streets-v8/#openstreetmap-ids]). Example: "Schloss Kyburg" is a relation with id 1169711, so it becomes 11697114.
+
=== 'geo' URI ===
 +
 
 +
Use URI Scheme "Uniform Resource Identifier for Geographic Locations " ('geo' URI).
 +
 
 +
For a promising implementation see [https://mangrove.reviews/standard Mangrove.reviews].
 +
 
 +
Example: Supermarket Denner Partner, Hombrechtikon, https://www.openstreetmap.org/node/6313169265
 +
* geo:47.2520925,8.7683656?q=DennerPartner&u=30  
 +
* [https://mangrove.reviews/search?sub=geo%3A47.2520925,8.7683656%3Fq%3DDenner%20Partner%26u%3D30&q=Denner,%20Hombrechtikon in Mangrove.reviews]
 +
 
 +
=== OpenLR ===
  
'''OpenLR''' (Location Referencing) a free spec. by TomTom for linear geometries like streets [http://www.openlr.org/].
+
OpenLR (Location Referencing) - a free spec. by TomTom for linear geometries like streets [http://www.openlr.org/].

Version vom 7. April 2020, 23:36 Uhr

 This is an unofficial proposal for a "permanent ID" (osm_pid) for OpenStreetMap (OSM). 
 See here for a more well known place for discussions. 

Goals and Requirements

The goal is to get an opaque (eventually fixed) length ASCII string for an OSM id.

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.

Status of OSM id

One can use OSM id nevertheless (at own risk)! Many variants are known:

As is with OSM id (bigint) and a code for Node, Way, Relation in front. Currently many applications depend on plain osm_id, eventually preceeded by node,way,relation (or N/W/R), like theses web applications:

Another usage of osm_id is to convert it to a single big integer: It's possible to encode the type (Node, Way, Relation) into the OSM id as a single 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.

 osm_id*10   -- Node
 osm_id*10+4 -- Relation
 osm_id*10+1 -- Way


Format

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

 [N|W|R]<osm_id>#<version>[+|-]<lon>[+|-]<lat>

where:

  • 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

OSM Permanent ID Service

In order to be really useful, a service should be implemented, which returns most recent object given a possibly old Permanent ID if an object has been changed; thus having another Permanent ID where any of it's parts may have changed (most probably just the version no.). Such a service must have access to the fully planet including the history and it must be reliable and responsive.

Alternatives

 See https://wiki.openstreetmap.org/wiki/Permanent_ID for a more official state of discussions. 

'geo' URI

Use URI Scheme "Uniform Resource Identifier for Geographic Locations " ('geo' URI).

For a promising implementation see Mangrove.reviews.

Example: Supermarket Denner Partner, Hombrechtikon, https://www.openstreetmap.org/node/6313169265

OpenLR

OpenLR (Location Referencing) - a free spec. by TomTom for linear geometries like streets [2].