Problem converting pbf to osm with Osmosis

1,624 views
Skip to first unread message

Martin Bernardi

unread,
Nov 8, 2012, 3:43:52 PM11/8/12
to mapsfo...@googlegroups.com
I want to download a map of Argentina for my Locus, as yo can see here usin this command: osmosis --read-pbf "hungary.osm.pbf" --mapfile-writer file="hungary.osm.map"
Ive installed Osmosis in C:\Users\Martin\osmosis-0.41\. I needed to install mapsforge plugin placing it on /lib/default and creating osmosis-plugins.conf on the folder config, because by placing the jar in /plugins it doesnt work
So Ive repaired the "Task type mapfile-writer doesn't exist." error, but now I get this:


nov 08, 2012 5:31:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.41
nov 08, 2012 5:31:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
nov 08, 2012 5:31:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
nov 08, 2012 5:31:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
nov 08, 2012 5:31:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline complete.
nov 08, 2012 5:31:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Total execution time: 584 milliseconds.
C:\Users\Martin\osmosis-0.41\bin>osmosis --read-pbf "argentina.osm.pbf" --mapfil
e-writer file="argentina.osm.map"
nov 08, 2012 5:32:23 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.41
nov 08, 2012 5:32:23 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
nov 08, 2012 5:32:23 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init
>
INFO: mapfile-writer version: mapsforge-map-writer-0.3.0
nov 08, 2012 5:32:23 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init
>
INFO: mapfile format specification version: 3
nov 08, 2012 5:32:23 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
nov 08, 2012 5:32:23 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
nov 08, 2012 5:32:23 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTas
kManager waitForCompletion
SEVERE: Thread for task 1-read-pbf failed
java.lang.AbstractMethodError: org.mapsforge.map.writer.osmosis.MapFileWriterTas
k.initialize(Ljava/util/Map;)V
        at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:43)
        at java.lang.Thread.run(Unknown Source)
nov 08, 2012 5:32:23 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed
.
        at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForComple
tion(Pipeline.java:146)
        at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
        at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Laun
cher.java:329)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:239)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

Thanks!

Ludwig

unread,
Nov 8, 2012, 6:18:51 PM11/8/12
to mapsfo...@googlegroups.com
I think this is a problem with osmosis 041 and an older version of the mapfile writer. Osmosis 041 requires slightly different code. One option is to use version 040, the other to build a new writer from svn.

Martin Bernardi

unread,
Nov 9, 2012, 12:32:01 PM11/9/12
to mapsfo...@googlegroups.com
So I can try with osmosis 0.40, but I cant find it, It isnt on the OSM Wiki (http://wiki.openstreetmap.org/wiki/Osmosis)
Also I dont understand when you say "build a new writer from svn". What is SVN?

Thanks for the fast answer :D

vklein

unread,
Nov 9, 2012, 2:55:08 PM11/9/12
to mapsfo...@googlegroups.com
SVN is a source repository. The build process is rather complicated , your have to install maven and some other things.

I think it is easier to get osmosis-0.41 and use it with the writer you have. I used this combination on a win 7 machine an it runs fine

Victor

Christian Kernbeis

unread,
Nov 10, 2012, 8:01:24 AM11/10/12
to mapsfo...@googlegroups.com
Hi,

I'v uploaded osmosis-0.40.1, you can find it here

www.openandromaps.org/files/tools/osmosis-0.40.1.zip

best regards
Christian


Am Freitag, 9. November 2012 18:32:02 UTC+1 schrieb Martin Bernardi:

Jürgen Broß

unread,
Nov 10, 2012, 8:46:17 AM11/10/12
to mapsfo...@googlegroups.com
Older osmosis versions are available here:
http://bretth.dev.openstreetmap.org/osmosis-build/

Regards,
Jürgen

On 10.11.2012 14:01, Christian Kernbeis wrote:
> Hi,
>
> I'v uploaded osmosis-0.40.1, you can find it here
>
> www.openandromaps.org/files/tools/osmosis-0.40.1.zip
>
> best regards
> Christian
>
> Am Freitag, 9. November 2012 18:32:02 UTC+1 schrieb Martin Bernardi:
>>
>> So I can try with osmosis 0.40, but I cant find it, It isnt on the OSM
>> Wiki (http://wiki.openstreetmap.org/wiki/Osmosis)
>> Also I dont understand when you say "build a new writer from svn". What is
>> SVN?
>>
>> Thanks for the fast answer :D
>>
>> El jueves, 8 de noviembre de 2012 20:18:52 UTC-3, Ludwig escribió:
>>>
>>> I think this is a problem with osmosis 041 and an older version of the
>>> mapfile writer. Osmosis 041 requires slightly different code. One option is
>>> to use version 040, the other to build a new writer from svn.
>>>
>>> On 9 November 2012 04:43, Martin Bernardi <martin...@gmail.com> wrote:
>>>
>>>> I want to download a map of Argentina for my Locus, as yo can see here<http://wiki.openstreetmap.org/wiki/Locus> usin
--


Jürgen Broß
Institute of Computer Science
Databases and Information Systems
Freie Universität Berlin
Takustr. 9
D-14195 Berlin, Germany
phone: +49 30 838-75108
email: juerge...@fu-berlin.de

signature.asc

Martin Bernardi

unread,
Nov 10, 2012, 1:28:54 PM11/10/12
to mapsfo...@googlegroups.com, juerge...@fu-berlin.de
Thanks, now with versiuon 0.40.1 it works.
Now Im having another error, It works well for 2 minutes but then says that Osmosis ran out of memory on the heap
It happens because the map is very big? is the full map of Argentina

Should I open a new topic for this?

INFO: written 20.0% of sub file for zoom interval index 2
nov 10, 2012 1:59:31 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTas
kManager waitForCompletion
SEVERE: Thread for task 1-read-pbf failed
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Unknown Source)
        at java.util.ArrayList.grow(Unknown Source)
        at java.util.ArrayList.ensureCapacityInternal(Unknown Source)

Will Kamp

unread,
Nov 10, 2012, 1:34:56 PM11/10/12
to mapsfo...@googlegroups.com, juerge...@fu-berlin.de
Martin,

You can give more memory to osmosis.  When creating a mapsforge map for the entire world zoom level 4 only I had to assign 6GB...

JAVACMD_OPTIONS=-Xmx6G

Of course, how much ram you can give to osmosis will depend on your machine and/or if you have 64bit java.

You can also consume much less ram by setting the zoom interval:

example

/opt/osmosis-0.41/bin/osmosis --rx file=world.xml --mapfile-writer file=world.map bbox=-85.6,-180.0,90.0,180.0 zoom-interval-conf=4,0,7

Will

Martin Bernardi

unread,
Nov 11, 2012, 8:47:45 AM11/11/12
to mapsfo...@googlegroups.com, juerge...@fu-berlin.de
Now it works! Thanks a lot! You are the best

I had to quotate the -Xmx6G part: 
JAVACMD_OPTIONS="-Xmx6G"

Thanks!
Reply all
Reply to author
Forward
0 new messages