Hello I have downloaded europe.osm.bz2 and I would like to exctract a large area using osmosis. Please forgive me for my ignorance, I am not a Linux / Unix at all and if I am missing something obvious, please advise. I am ammending this script I found on the http://wiki.openstreetmap.org/wiki/Osmosis#Extracting_bounding_boxes. Published script:
My ammended script:
Quite frankly I do not even know what the symbol really stands for and if it necessary on windows. I am assuming the | is some pipeline notification. Here is what I am getting back. bzcat.exe: I/O or other error, bailing out. Possible reason follows. bzcat.exe: Invalid argument Input file = I:europe.osm.bz2, output file = (stdout) C:Mapyosmosis-0.38bin>--read-xml enableDateParsing=no file=CONIN$ '--read-xml' is not recognized as an internal or external command, operable program or batch file. C:Mapyosmosis-0.38bin>--bounding-box top=51.2 left=11.7 bottom=47.6 right=23.0 --write-xml file=- '--bounding-box' is not recognized as an internal or external command, operable program or batch file. | was unexpected at this time. Please advise. asked 19 Jan '11, 13:47 Tomas Pajonk |
Since this is more than a year old, I assume it is answered or not a problem. I agree however that the main problem is a Windows problem with the command syntax. For one thing, Windows commands cannot be continued. answered 24 May '12, 00:49 Sam Hobbs |
It seems like you need to write everything on one line (or something). This is an error from DOS/Windows:
Also I think you forgot the last pipe, try to just export to OSM (or pbf) and see if that works, so write it like this:
answered 20 Jan '11, 22:01 emj Why is bzcat used? I thought Osmosis could read .bz2 files anyway?
(25 Mar '11, 10:02)
EdLoach ♦
1
running gz/bz2 as a separate task doesn't hurt and the Java implementations have been known to be buggy (e.g. java had/have problems with gzip concatenated streams).
(31 Mar '11, 21:11)
emj
|
Instead of file=CONIN$ you have to use file"-" (see http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.39) In my example i used 7-zip (bzcat should work as well when using -d -c as parameters) c:Programme7-Zip7z.exe e -so I:AdminThomasosmxmleurope.osm.bz2 | D:OSMosmosisbinosmosis.bat --rx file="-" --tf accept-ways highway=motorway,trunk,primary --used-node --write-xml file="I:AdminThomasosmxmleuropa_einfach_highway.osm" This extracts motorway, trunk and primary street from europe answered 25 Mar '11, 08:32 tmandel |
All that I can reliably tell from that error message is that bzcat.exe (not osmosis) is unhappy. So this is not directly openstreetmap related. Check the documentation if the input filename should be I:/europe.osm.bz2 rather than I:europe.osm.bz2. Also you might have to use bzip2.exe instead of bzip, but that is unrelated as it breaks down before it ever reaches that stage. answered 19 Jan '11, 13:55 petschge When I supplied an incorect file name the error message was different.
(19 Jan '11, 14:08)
Tomas Pajonk
I made a wrong call with the bzcat.exe. I should have called just bzcat.
(19 Jan '11, 14:09)
Tomas Pajonk
I'd also recommend using europe.osm.pbf instead of .bz2, it's probably much faster to process by osmosis.
(19 Jan '11, 14:33)
Breki
Would I then use Osmosis directly on the pbf or do I have to extract it somehow ?
(19 Jan '11, 14:50)
Tomas Pajonk
1
(19 Jan '11, 17:35)
Breki
|