[OSM-dev] Osmosis --ac changed?

Brett Henderson brett at bretth.com
Sun Dec 21 23:03:58 GMT 2008

The switch may have been a bad idea.  It's not very intuitive.

There was a reason behind it though.  With the old queue based approach 
sometimes there was no way to get the tasks connected properly without 
using named pipes.  With the stack based approach I think it's always 
possible to connect tasks without using named pipes.

Consider this example:
I want to read two xml files, apply a change to both of them, then merge 
the two results into a single output file.

With the old queue approach.
osmosis --rx file1.osm --rxc change1.osc --ac --rx file2.osm --rxc 
change2.osc --ac --merge --wx out.osm
This fails because the second --ac takes the first --ac result as the 
first input and the second --rx as the second input.  I can't think of a 
way to re-order tasks to get around the problem.

With the new stack approach.
osmosis --rxc change2.osc --rx file2.osm --ac --rxc change1.osc --rx 
file1.osm --ac --merge --wx out.osm
This works (I haven't tried it but I assume it does :-).

So the stack based approach is more flexible, but takes a few more 
mental gymnastics to get it right.  To be honest I haven't found it too 
bad one I got used to it.

It was originally a suggestion by Martijn, but if the general consensus 
is that it's confusing I can revert it back again.

Frederik Ramm wrote:
> Hi,
> Karl Newman wrote:
>> I think it's because of a change to a stack-based command-line parsing (from
>> a queue). Try swapping the position of the --rx and --rxc parameters.
> Works, thanks. A bit conter-intuitive if you ask me, perhaps I should 
> make it a habit to use named pipes...
> Bye
> Frederik

More information about the dev mailing list