My question is what happens with way_id, node_id as time goes? Are they always permanently bound to the real world entities they were first time assigned (some geographical object like a highway or river for ways and simple coordinate for nodes) or they could change their real world counterparts over time ?

asked 02 Dec, 21:56

Stan%20Sokolov's gravatar image

Stan Sokolov
111
accept rate: 0%


The IDs are not permanent. They can change for various reasons, e.g.:

  • something is deleted and re-created (the old ID will become unused)
  • something is split into several parts (the old ID will either become unused or refer to only one of the parts)
  • several things are merged into one (it is possible that one of the old IDs then refers to the whole thing and the others become unused)

Do not rely on IDs remaining constant.

permanent link

answered 02 Dec, 22:07

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
71.3k846451113
accept rate: 24%

We are working on a routing framework that uses permanent route keys that contain entire path. In certain scenarios it was desired to repeat route exactly the same way without any modifications. We were using a way:node id sequence to encode route, however it seems to be not a legit option as those IDs are not permanent. Hmm very sad. Seems that our problem has no solution as coordinates of nodes could also be moved with map modifications. So there is no way to force a route go exactly the same path as was found suitable a certain time before.

(02 Dec, 23:11) Stan Sokolov

Maybe it would work to store the coordinates directly? That way you know they aren't going to change.

(03 Dec, 00:37) maxerickson

We have some additional metadata attached to OSM ways that we would like to append to the route each time someone uses it. If we store coordinates we will need to figure out which OSM way this coordinate lays on that is an expensive step for us. Ideally we would like to have a quick way to match route with OSM ways and get the metadata from the place we store it (Redis at this moment). Also as of now we only store OSM way:node id at places where route switches from one OSM way to another, skipping all the nodes in between. But if we store the coordinates we would need to store the entire path what will make us to transmit more data. Many downsides of this approach.

Take example of a person who walks the same way from one place to another 2.5 miles every day and back just for some purpose (let say a servicemen). He also has a few alternative routes in case if they provide more service targets. We have the information stored in Redis that is updated every minute about service targets assigned to OSM ways/nodes and we would like quickly figure out which alternative route has more places for service. When we store ways:nodes we could easily match route against list of targets.

(03 Dec, 01:12) Stan Sokolov
1

But as soon as someone splits a road (e.g. different sidewalks, max speed, a bus route that uses only part of the OSM-way), you will have to adapt your route and add the extra OSM way otherwise, you have a gap in your route

(03 Dec, 04:08) escada
1

But if we store the coordinates we would need to store the entire path what will make us to transmit more data

Look into Google polyline format.

(03 Dec, 06:31) Richard ♦
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:

×92
×39

question asked: 02 Dec, 21:56

question was seen: 85 times

last updated: 03 Dec, 06:31

powered by OSQA