[OSM-dev] Recursive relations

Andrew M. Bishop amb at gedanken.demon.co.uk
Sun Sep 13 10:56:29 BST 2009


In OSM a relation can contain other relations but it seems that there
is nothing to check that a relation doesn't contain itself.  I can't
think of any legitimate reason that it should be allowed though.

For example relation 15852 has contained itself since version 108
which was created at the beginning of July (changeset 1754423).

Within the UK alone the following route relations all contain
themselves:

12179
15852
80545
101440
163368
165638
165638
167468
168189
170290
170290

Also within the UK there is one boundary relation that contains
itself:

57535


Obviously it is possible to ignore these when parsing the data (which
is what I do and what alerted me to them in the first place) but it
would be better if it didn't happen.


This is probably something that the OSM editors should warn users
about when they try to create such a relation.

Is there somebody that can find and fix all such relations on the
server (if they have no legitimate use)?

Obviously self-recursion is easy to find; there might be mutually
recursive relations as well but I haven't looked for them.

-- 
Andrew.
----------------------------------------------------------------------
Andrew M. Bishop                             amb at gedanken.demon.co.uk

UK OpenStreetMap Route Relations:
        http://www.gedanken.org.uk/mapping/osm-routes/route.html

UK OpenStreetMap Boundary Relations:
        http://www.gedanken.org.uk/mapping/osm-boundaries/boundary.html




More information about the dev mailing list