[osmosis-dev] Improve relation extraction handling

Frederik Ramm frederik at remote.org
Sun Nov 7 11:44:26 GMT 2010


Hi,

    I'm a major user of the --bp task in Osmosis, for the nightly 
Geofabrik country extracts. I cannot use the complete-something flags as 
that would take far too much time, and on the whole the 
"clip-incomplete-entities" mode seems not to be too bad for users.

There's one thing that has popped up on this list however ("lost 
relations while clipping") which is an increasing concern to our users 
and which I hope I can fix. The problem is that with cascading 
relations, Osmosis will only include a relation if one of its children 
has been included already, so if

node N1 is inside the clipping area,
relation R1 contains node N1,
relation R2 contains relation R1

then relation R1 will alway be included in the output, but relation R2 
will only be included if it comes after R1 in the input file.

Now while using the temporary storage for nodes and ways would be too 
expensive for the nightly Geofabrik build, I think that temporarily 
storing relations would be acceptable (as there aren't too many). I'm 
thinking of adding a "cascadingRelations=yes" flag to the --bp/--bb 
tasks that would

* process relations not containing other relations as usual,
* throw all other relations onto a stack and process them in a suitable 
order afterwards

I am aware that determining a "suitable order" could be difficult if you 
have many levels of cascasing (or even circular) relations, and that the 
output file would not be ordered properly, but I think such an option 
would mean a big improvement at a relatively low cost.

1. Any comments?
2. Anyone done something like that already?
3. Is any of Osmosis' internal storage mechanisms suitable for buffering 
relations in this way or do I have to invent something new?

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"



More information about the osmosis-dev mailing list