On Tue, May 18, 2010 at 1:42 AM, Christoph Wagner <
freemaps....@googlemail.com> wrote:

> Hello list,
>
> I am new to this dev-list. My name is Christoph Wagner and I maintain the
> Garmin All in one Map:
> http://wiki.openstreetmap.org/wiki/All_in_one_Garmin_Map
>
> I want to reduce some server load (I omit details here) and tried to filter
> OSM-Data with osmosis.
>
> For example I have the problem to filter out all kind of adresses in an
> osm-file.
> My first guess was that:
>
> osmosis-0.35.1/bin/osmosis --rx input.osm --t outPipe.1=points \
> --wk keyList="addr:interpolation,addr:housenumber" --un --s \
> --nk inPipe.0=points keyList="addr:housenumber" --s \
> --m --wx addr.osm
>
> The Problem is, that osmosis never finishes. I wonder why.
> No error, no writing, no CPU-usage - it just waits and does nothing.
> There must be something wrong with the --m I guess, but I don't know what.
>
> This one here does what I want, but needs to write out and read in again
> xml files for that:
>
> osmosis-0.35.1/bin/osmosis --rx input.osm --t outPipe.1=points \
> --wk keyList="addr:interpolation,addr:housenumber" --un --s --wx
> addr_lines.osm \
> --nk inPipe.0=points keyList="addr:housenumber" --s --wx addr_points.osm
>
> osmosis-0.35.1/bin/osmosis --rx addr_lines.osm --rx addr_points.osm --m
> --wx addr.osm
>
> Is this behaviour wanted? Can somebody give me a hint to do it better?
> I have no idea what is wrong.
>

Hi Christoph, you are experiencing deadlock between threads in the Osmosis
pipeline.

You can't split data into two pipes, then combine it back together again in
a later task.  The tee task passes all input data to both output pipes.  If
one of those output pipes is blocked, the entire tee task will stop until
the pipe clears.  Several tasks downstream from the tee task is the merge
task which requires both input pipes to have reached the same entity in
order to perform comparisons.  It will block reading of the pipe with newer
data until the pipe with older data catches up.  In between the tee and
merge tasks are tasks that may be discarding data or waiting for special
events before releasing data to the next task along.  The merge task is
blocked waiting for data that will never be sent because the tee task is
also blocked waiting for the merge task to read.  I may not be making much
sense here, but the end result is that the merge task may stop reading one
input pipe waiting for data from another that never comes because the tee
task is blocked on writing to the pipe that the merge task has stopped
reading.

To summarise, if you can draw a graph of the data flows in Osmosis, ensure
that you never have data being split then recombined at a later point.

In your case the only option is to split it into two steps using temporary
XML files as you already appear to be doing.

It would be nice if Osmosis could detect this situation and throw an error,
but it would take a lot of effort and add a lot of complexity that I don't
really wish to attempt.

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

Reply via email to