Locus Map - forum

Content & Tools => Tools => Topic started by: CaLocus on September 07, 2011, 07:15:38

Title: Help with Osmosis osm conversion
Post by: CaLocus on September 07, 2011, 07:15:38
Does anyone know how to correct the "SEVERE" errors pasted below that I get when I try to run "osmosis -v --rx file=C:OpenStreetMapMapstest.osm --mapfile-writer file=C:OpenStreetMapMapstest.osm.map" ?
 

    FINE: Waiting for task 1-rx to complete.
    Sep 6, 2011 4:51:01 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTask
    Manager waitForCompletion
    SEVERE: Thread for task 1-rx failed
    java.lang.NullPointerException
            at org.mapsforge.preprocessing.map.osmosis.MapFileWriterTask.release(Map
    FileWriterTask.java:192)
            at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:125)
            at java.lang.Thread.run(Unknown Source)
    Sep 6, 2011 4:51:01 PM org.openstreetmap.osmosis.core.pipeline.common.PassiveTas
    kManager waitForCompletion
    FINE: Task 2-mapfile-writer is passive, no completion wait required.
    Sep 6, 2011 4:51:01 PM org.openstreetmap.osmosis.core.Osmosis main
    SEVERE: Execution aborted.
    org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed
    .
Title: Re: Help with Osmosis osm conversion
Post by: ymerejo42 on September 24, 2011, 16:56:43
I hit the same error, you need to convert your .osm (xml format) file to a .osm.pbf (binary format) file first. Here's the command to do it, assuming your .osm file is named "map.osm".

osmosis --rx map.osm --wb map.osm.pbf
Once you've done that, I think it should work. I'm converting a map of West Virginia right now, I'll let you know when it's done if it worked.
Title: Re: Help with Osmosis osm conversion
Post by: ymerejo42 on September 24, 2011, 17:17:12
Well, I got it converted to the .pbf format, but I can't get the mapwriter plugin to work. It's giving me a different set of errors than you are getting, I'll have to work on it when I get back home later tonight.
Title: Re: Help with Osmosis osm conversion
Post by: CaLocus on September 25, 2011, 07:16:02
I have also tried pbf files and get different errors.  Now it is tells me I have to use bbox.  When I use bbox definition (e.g. "--mapfile-writer file=<pathfile-name> bbox= minLat,minLon,maxLat,maxLon" ,  I get the "SEVERE" error "Bound element must come before any entities."
Title: Re: Help with Osmosis osm conversion
Post by: kaare on September 26, 2011, 13:28:35
I also had difficulties using osmosis with pbf maps, and found a way around the problem using the type=hd parameter (instead of default ram) of the mapfile-writer plugin. The full command becomes
osmosis --rb file=input.pbf --mw file=output.map type=hd