Osmosis does not clip the flow of changes by a bounding-polygon

I ran into a problem using the --bounding-polygon option in osmosis.

When you deploy data into fresh DB this set of parameters helps you to achieve your goal by clipping data using predefined *.poly (bounding-polygon).

osmosis \
--read-pbf file=some.osm.pbf \
--bounding-polygon file=clip.poly 
--write-apidb …

But when you try to do the same for stream of changes (*.osc) osmosis throw an error

Task 2-bounding-polygon does not support data provided by default pipe stored at level 1 in the default pipe stack.

osmosis \
--read-replication-interval workingDirectory=$DATA_DIR/replication_in \
--bounding-polygon file="$poly_file" \
--wxc $DATA_DIR/osm.osc
👈 see log here (click for more details)

or in case with local osm.osc file, we see the same behaviour

osmosis \
--rxc $DATA_DIR/osm.osc \
--bounding-polygon file="$poly_file" \
--wxc $DATA_DIR/osmc.osc
👈 see log here (click for more details)

If you don’t use --bounding-polygon for clipping stream of osm-changes, you get updates from around the world, and no error. However, the task is to store only changes for a certain area.

osmosis \
--read-replication-interval workingDirectory=$DATA_DIR/replication_in \
--wxc $DATA_DIR/osm.osc
👈 see log here (click for more details)

:question: Are there any specific things that aren’t in the documentation about how to force osmosis to truncate the stream of osm-changes by using --bounding-polygon?

P.S.
As an interim solution, I’m currently using osmconvert to trim the change stream.
For example, like this:

osmosis \
--read-replication-interval workingDirectory=$DATA_DIR/replication_in \
--wxc - | \
osmconvert - -B=$DATA_DIR/clip.poly --out-osc > $DATA_DIR/osct.osc && \
osmosis \
--rxc $DATA_DIR/osct.osc \
--wxc $DATA_DIR/osmz.osc

8 posts - 4 participants

Read full topic


Ce sujet de discussion accompagne la publication sur https://community.openstreetmap.org/t/osmosis-does-not-clip-the-flow-of-changes-by-a-bounding-polygon/9316