This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Osmosis boundary box problem

0

Hello,

I am new to OSM and am trying to use Osmosis in Linux to extract an area of the UK to work with. I have used the command below as described on the web site but it comes back saying:

Argument file for task 2-bounding-box was not recognised.

My command is: osmosis --read-xml file="great-britain-latest.osm" enableDateParsing=no file=- --bounding-box top=52 left=-7 bottom=39.5 right=-1 write-xml file="WestCountry.osm"

I'm not sure what the "file=-" just before --boundary-box is for but I tried taking that out and that didn't work either. Any help would be appreciated.

Thanks

asked 18 Apr '13, 12:47

Christ0's gravatar image

Christ0
1111
accept rate: 0%


One Answer:

1

The correct invocation is (everything on one line of course):

osmosis --read-xml file="great-britain-latest.osm" enableDateParsing=no --bounding-box top=52 left=-7 bottom=39.5 right=-1 --write-xml file="WestCountry.osm"

(Note the double dash before write-xml.)

Both occurrences of file= are optional.

Your command line looks as if you downloaded and manually decompressed a Geofabrik extract. Your command will run much faster if you download the .pbf file and then instead of --read-xml use --read-pbf directly with the .pbf file you downloaded.

answered 18 Apr '13, 13:22

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 18 Apr '13, 13:22

1

also have a look at the programs called osmfilter and osmconvert ... search the OSM wiki about them.

In some scenarios they might be faster and easier to handle than osmosis.

(18 Apr '13, 16:46) stephan75

Thanks for your help, I spotted the typo in the end and have managed to execute the command. I will try and use the other tools. It seems to take quite a long time to convert. I have a 10GB file of the UK and I am trying to extract the West Country. It has been sat there for four hours now saying:

Pipeline executing, waiting for completion.

The CPU is sat there at barely 5% useage and I can only assume that nothing is happening.

Is this correct?

Thanks

(18 Apr '13, 16:57) Christ0

Source code available on GitHub .