[OSM-talk] Relations not always brilliant

Steve Hill steve at nexusuk.org
Mon Apr 7 12:42:05 BST 2008


On Mon, 7 Apr 2008, Stephen Gower wrote:

>  Suppose I wanted to walk the whole of the A34 while I was 34 as a
>  charity gig?

Ok, either:
1. You have lots of ways tagged with ref=A34
2. You have lots of relations tagged with ref=A34, one for each 
discontinuous section of the road (which may be multiple ways)
3. You have a single relation tagged with ref=A34, containing all of the 
ways making up the A34, but with gaps where there are discontinuities.

In the case of (1) the API needs some work to make it possible to search 
for single values in multivalue tags.  You can then search for ref=A34 and 
get a list of ways back.

For (2) you can search for ref=A34 and get a list of relations (and 
therefore a list of ways).

For (3) you can search for ref=A34 and get a single relation (and 
therefore a list of ways).

In all of these cases, there is nothing especially non-trivial.  You might 
get a performance improvement from (2) and (3) since you don't have to 
parse so many tags (and the parsing isn't as complex since they only have 
a single value in the tag).  But (3) doesn't seem to be better than (2).

Whichever method you have taken, you end up with the same data - a list of 
ways with gaps in them where there are discontinuities.  You must fill in 
those gaps yourself (e.g. using a routing algorithm) and OSM can't do this 
for you.  Different people will have different preferences for how to fill 
in those gaps - car drivers may prefer motorways whilst you, on your walk, 
probably want a shortest-distance non-motorway route.  You may even choose 
to reference third party data, such as land elevations to allow you to go 
around large hills instead of over them.

>  OK, that's contrived, but beware of arguments that
>  apply to just one use-case (for what its worth, I'm undecided about
>  if relations in this situation are brilliant or not brilliant).

Noted.  But I still haven't seen any good explanation as to why we need 
the whole of a discontinuous road in a single relation.

The only good reasoning I've seen for using relations at all is for 
performance and consistency reasons (which are good points, but I don't 
think that requires a discontinuous road in a single relation - if we 
stick to continuous roads in each relation then the relation generation 
can be automated, which would ensure consistency, reduce the scope for 
human error and make data submition easier.)

  - Steve
    xmpp:steve at nexusuk.org   sip:steve at nexusuk.org   http://www.nexusuk.org/

      Servatis a periculum, servatis a maleficum - Whisper, Evanescence





More information about the talk mailing list