Error: Unexpectedly long header

306 views
Skip to first unread message

salil GK

unread,
Nov 4, 2013, 11:28:31 AM11/4/13
to mapsfo...@googlegroups.com
Hello

   I was trying to convert .osm to .map file. I downloaded and build 0.40 version of osmosis. the below is the error message I am getting.

:~/workspace/source/osmosis-0.40$ ./bin/osmosis --rb file=map_b.osm --mapfile-writer file=bang.map type=hd
Nov 04, 2013 9:55:00 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40
Nov 04, 2013 9:55:00 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Nov 04, 2013 9:55:00 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile-writer version: mapsforge-map-writer-0.3.0
Nov 04, 2013 9:55:00 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile format specification version: 3
Nov 04, 2013 9:55:00 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Nov 04, 2013 9:55:00 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
crosby.binary.file.FileFormatException: Unexpectedly long header 65536 bytes. Possibly corrupt file.
    at crosby.binary.file.FileBlockHead.readHead(FileBlockHead.java:50)
    at crosby.binary.file.FileBlock.process(FileBlock.java:130)
    at crosby.binary.file.BlockInputStream.process(BlockInputStream.java:34)
    at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:37)
    at java.lang.Thread.run(Thread.java:722)
Nov 04, 2013 9:55:00 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline complete.
Nov 04, 2013 9:55:00 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Total execution time: 619 milliseconds.

Not sure what the issue is

Attahced is the .osm file.

Thanks
~S
map_b.osm

emux

unread,
Nov 4, 2013, 11:50:35 AM11/4/13
to mapsfo...@googlegroups.com
Hi,

It seems you're using wrong reading task at osmosis.
The --rb task is for reading binary files (e.g. .osm.pbf).
For xml osm files (like in your command) you need the --rx task.

osmosis --rx file=country.osm --s --mw file=country.map type=hd bbox=minLat,minLon,maxLat,maxLon tag-conf-file=tag-mapping.xml
is different from
osmosis --rb file=country.osm.pbf --s --mw file=country.map type=hd bbox=minLat,minLon,maxLat,maxLon tag-conf-file=tag-mapping.xml

Also you need to take care of tag mapping xml. If you don't provide any, then the default one is used.
If your osm has custom tags then you have to implement your own tag mapping xml, otherwise the produced map will be empty.

Regards.
Reply all
Reply to author
Forward
0 new messages