[OSM-dev] Proposal: Make relations ordered

Jo ml at winfix.it
Mon Mar 17 07:04:17 GMT 2008


Frederik Ramm wrote:
> Hi,
>
>    at SOTM '07 I discussed relations with a lot of people, and some
> said they think relation members should be ordered, like nodes are in
> a way. I maintained that that was unnecessary because if need be, you
> can always use the "role" to specify an order; and that's how it got
> implemented.
>
> Meanwhile I think this was short-sighted of me; in numerous
> discussions people have demonstrated a need for (or at least: the
> usefulness of) ordered relations.
>
> One simple example is a bike/walking/bus route that has a little loop,
> formed like those "ribbons" you often see in signatures:
>    _
>   < >
>    X
>   / \
>
> Currently you can only specifiy the ways that are members of this, but
> you cannot specify in what order you have to follow them. 
>
> I think we should switch to ordered relations. The way I would do this
> is not change anything in the XML, just add an extra "sequence" column
> to the relation membership table internally. Any old client would
> still work, but they'd have to be upgraded to make use of the
> ordering. We would prepare the migration and the next time we have
> some sort of downtime anyway, just pull it through. It would cost us a
> few more bytes in storage.
>
> Thoughts?
>   
Please think through what needs to happen when a way is split. Can the 
order be given like 10,20,30, so 15 and 25, 28 can be added in between? 
Or would a trigger in the database take care of reordering all the 
elements automatically? Also please change the API, so merging and 
splitting of ways doesn't have an influence on route relations. This 
would take away the responsibility of the editors to do this.

In itself, I think it's a great idea!

Polyglot




More information about the dev mailing list