[OSM-talk] Advanced relationships
Ian Sergeant
isergean at hih.com.au
Thu Jun 14 01:15:26 BST 2007
> I've been thinking how to implement autorouting with turn restrictions
> on bidirectional ways. The autorouter will have records (x, d, t, b)
> stating that the car can reach segment x with the car traveling in
> direction d (forward or backward) in time t with a "back" pointer b,
> i.e. t = b->t + time it takes to travel b->x. (x, d) is a key field
> for the records.
A turning restriction is just a link between two segments with a
restriction applied - a segment pair + restrictions.
Restrictions are already well defined with OSM tags.
A "no right turn" would just be a segment pair tagged with the restriction
"access=no". A no right turn into a street, but a right turn permitted
from the street back, would be a segment pair tagged with the restriction
"oneway=yes". One some occasions there is a need for an additional
instruction to the driver - like "stay right". A new segment pair tag
"instruction" could cater for this. Just tag the segment pair with
"oneway=yes" "instruction=keep right" or similar. This method allows for a
diversity of restrictions, for example, no right turn for heavy vehicles.
Left turn only for bicycles. No right turn during peak hours etc.
The only remaining question is how to represent the segment pair. My
suggestion is to use a way, since that is the only current way to link two
segments. A new way tag would be needed.
I know there are probably better and cleaner methods for implementing
routing, but this method would give a fully expressive method using only
two new tags and no change to the OSM data model. It would not require any
immediate change to renderers, or to editors. It is certainly considerably
cleaner than additing additional oneway ways that don't really exist. If a
better method was devised in future, it could be easily converted as the
data is separated from the other OSM data by the specific way tag. A
method which consists of linking segments without using the OSM retrictions
means that it will struggle to encode bicycle only, heavy vehicle, and
other routing restrictions.
I know the routing issue comes up frequently, and the response often seems
to be that it is too hard for now. I think it needs focus, as I think it
is significant to the success of the whole project, otherwise we risk
ending up with a map of the world that is just a pretty picture.
Ian.
More information about the talk
mailing list