[OSM-dev] Extracting just national boundaries

Igor Podolskiy igor.podolskiy at vwi-stuttgart.de
Fri Aug 5 16:24:25 BST 2011


Hi Curt,

the relation 11980 seems to be a part of an experiment/proposal to make 
the big boundary relations easier to handle (for some definition of 
"easy" - it definitely doesn't make it easier to _filter_ them...):

http://wiki.openstreetmap.org/wiki/France_boundary_pyramidal_construction
http://wiki.openstreetmap.org/wiki/Relations/Proposed/boundary_segment

In case of France, there is this another relation 1403916 which 
represents the French border in the "old" way, i.e. a single relation 
that contains segments directly. However, 1403916 is the sea border of 
France (coastline + 12 miles zone), which might not be what you want 
depending on your application.

As to this boundary/boundary/boundary_segment construct... it _is_ hard 
to filter in the common case, at least with Osmosis (other tools I don't 
know, but I suspect it isn't easy there either). The problem is that 
there are no bounds on relation nesting. Basically, to implement a 
--used-relations you need to compute the transitive closure of a 
possibly cyclic graph with relations as nodes and memberships as edges, 
and this is not trivial if all you have is a data stream and no loops - 
which is the Osmosis model.

I can try to cough up a possible --used-relations just for the fun of 
it... but if I were in your shoes, I wouldn't wait for that :) For all I 
know, I might fail to produce any code worth sharing because of some 
problem I didn't think of yet.

There are some other options I can imagine:
1. Use other tools - if Markus says his tool can handle this, that's cool :)
2. Try to make any sense of level 4 boundaries - they all are done in 
the old-fashioned way, so theoretically the union of all level 4's 
should correspond to level 2/3.
3. Do some custom processing for your application for this specific 
tagging schema.

In the end, it is about what you want to do in your use case afterwards 
- without that, it's hard for me to say what solution will work for you.

Sorry for the long and mostly negative answer - but it is what it is... 
and if anyone has a better answer, I would be interested in that, too :)

Bye
Igor



More information about the dev mailing list