Hi Maxim,

2010/10/12 Maxim Dubinin <s...@gis-lab.info>

> Hi osmosis-devs,
>
> On our regional extraction system we've ran into what seems to be a
> bug.
>
> Relations, that are members by themselves are dropped while extracting.
>
> Example of such relation:
> http://www.openstreetmap.org/browse/relation/358215
>
> Code and example to reproduce this behavior is attached.
>

Thanks for the detailed example, it makes it much easier to diagnose your
issue.

The reason for the dropped relation is a limitation of how Osmosis performs
bounding-box/bounding-polygon processing.  Osmosis processes all data in a
stream.  First it processes all nodes one by one and keeps track of which
nodes are in the bounding box.  It then processes each way one by one and
uses the node list to determine which ways are in the bounding box.  Then it
processes the relations one by one and uses the list of nodes, ways, and
already selected relations to determine if a relation is in the bounding
box.

In your example, relation 795 is processed first and contains relation 792.
But 792 hasn't been processed (in your example, the two ids are out of
order) yet so Osmosis doesn't know that it will be inside the bounding box
and ignores it.  It then processes 792 which has two ways inside the
bounding box so it includes that relation.  But it never goes back to
include relation 795 because it has forgotten about it.  In your example, if
you switched the order of relation 792 and 795 then 795 *would* get
included.

The only way to avoid this limitation is to replace your existing --bp step:
--bp file=test.poly
with
--bp file=test.poly completeWays=yes completeRelations=yes

This makes Osmosis run *much* slower and might not be acceptable.  With
those options enabled, it builds temporary stores of nodes, ways and
relations so that it can go back and randomly access data.  But the
temporary data stores are quite slow which has a very large impact on
performance.

Hope that helps.

Brett
_______________________________________________
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/osmosis-dev

Reply via email to