[OSM-dev] osmosis, tee and bounding boxes

Lambertus osm at na1400.info
Sun Sep 7 19:28:24 BST 2008


Funny, I tried the same syntax as well yesterday and had the same 
behavior. A workaround is to use the 'full' syntax where you define the 
inPipe.n and outPipe.n for every part of the commandline as well as the 
outputCount for tee. Example:
nice bzcat planet.openstreetmap.org/planet-latest.osm.bz2 | nice osmosis
--rx file="-" enableDateParsing="no" outPipe.0="planet"
--t inPipe.0="planet" outputCount=4 outPipe.0="t0" outPipe.1="t1" 
outPipe.2="t2" outPipe.3="t3"
--bb inPipe.0="t0" left=-30 right=-168 idTrackerType="BitSet" 
outPipe.0="eur"
--bb inPipe.0="t1" left=-168 right=-100 bottom=13 idTrackerType="BitSet" 
outPipe.0="nwa"
--bb inPipe.0="t2" left=-100 right=-30 bottom=13 idTrackerType="BitSet" 
outPipe.0="nea"
--bb inPipe.0="t3" left=-168 right=-30 top=13 idTrackerType="BitSet" 
outPipe.0="sa"
--wx inPipe.0="eur" file="eurasia.osm.gz"
--wx inPipe.0="nwa" file="northwestamerica.osm.gz"
--wx inPipe.0="nea" file="northeastamerica.osm.gz"
--wx inPipe.0="sa" file="southamerica.osm.gz"

It's difficult to read with all those pipe constructions but, most 
importantly, it works.


Igor Brejc wrote:
> Hello,
>
> I'm trying to split an OSM file into 4 regions defined by bounding 
> boxes. When I use the following command line options:
>
>     --read-xml output.osm
>     --tee 4
>     --bounding-box left=15 top=46 right=17 bottom=45
>     --bounding-box left=15 bottom=46 right=17 top=47
>     --bounding-box right=15 top=46 left=13 bottom=45
>     --bounding-box right=15 bottom=46 left=13 top=47
>     --write-xml SloveniaGarminSE.osm
>     --write-xml SloveniaGarminNE.osm
>     --write-xml SloveniaGarminSW.osm
>     --write-xml SloveniaGarminNW.osm
>
> I get 3 files with identical content and one with no OSM data inside 
> (SloveniaGarminSE.osm).
> But if I call osmosis for each region separately (without using the -tee 
> option), it works as it is supposed to.
>
> Am I doing something wrong? Thanks in advance
>
> Igor
>
>   






More information about the dev mailing list