Interested in creating/updating a New Zealand .map file

90 views
Skip to first unread message

Gavin Treadgold

unread,
Jan 9, 2013, 8:06:01 PM1/9/13
to mapsfo...@googlegroups.com
Hi,

I'm a new user, that has come in via the geocaching application CacheSense <https://play.google.com/store/apps/details?id=nz.barees.android.cachesense>. If someone can help me get the build process set up, or point me in the right direction, I'd be keen to create more regular builds of a .map file for New Zealand (which is currently part of a combined Australia/New Zealand map). I wouldn't call myself a developer, but I'm somewhat comfortable working on the command line, so if someone can give me enough pointers to set the process up, I'm sure I can do the boring work of downloading the relevant OSM extract, and do the build say once a month.

Keep up the great work!

Cheers Gav

Corey Wallis

unread,
Jan 9, 2013, 8:13:41 PM1/9/13
to mapsfo...@googlegroups.com
HI Gavin,

There are directions for sertting up Osmosis and the mapsforge file
writing plugin here:

http://code.google.com/p/mapsforge/wiki/GettingStartedMapWriter

There is a New Zealand PBF file here:

http://download.geofabrik.de/openstreetmap/australia-oceania/

Which may suit your needs better than creating your own extract.

Hope this helps.

-Corey
> --
>
>

Gavin Treadgold

unread,
Jan 9, 2013, 11:13:39 PM1/9/13
to mapsfo...@googlegroups.com
Hi Corey,

It mostly helps ;)

I've got Osmosis installed and running on OS X 10.8. I've used the Geofabrik NZ.pbf you linked to. I tested this worked with the command below:

GT-Laptop:Downloads gpt$ osmosis --rb file="new-zealand.osm.pbf" --write-xml file="new-zealand.osm"
10-Jan-2013 17:04:21 org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.41
10-Jan-2013 17:04:22 org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
10-Jan-2013 17:04:22 org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
10-Jan-2013 17:04:22 org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
10-Jan-2013 17:05:20 org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline complete.
10-Jan-2013 17:05:20 org.openstreetmap.osmosis.core.Osmosis run
INFO: Total execution time: 58949 milliseconds.
GT-Laptop:Downloads gpt$

Which I assume means that both the Osmosis installation, and the datafile are good. However, when I try to run the command to create the .map file, everything seems to fall over.

GT-Laptop:Downloads gpt$ osmosis --rb file="new-zealand.osm.pbf" --mapfile-writer file="new-zealand.map"
10-Jan-2013 17:07:24 org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.41
10-Jan-2013 17:07:24 org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
10-Jan-2013 17:07:25 org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile-writer version: mapsforge-map-writer-0.3.0
10-Jan-2013 17:07:25 org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile format specification version: 3
10-Jan-2013 17:07:25 org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
10-Jan-2013 17:07:25 org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
10-Jan-2013 17:07:25 org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-rb failed
java.lang.AbstractMethodError: org.mapsforge.map.writer.osmosis.MapFileWriterTask.initialize(Ljava/util/Map;)V
at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:43)
at java.lang.Thread.run(Thread.java:680)
10-Jan-2013 17:07:25 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.waitForCompletion(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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
GT-Laptop:Downloads gpt$

I've had a little poke around the email archives, and saw some similar error messages, but wasn't able to figure out what the solution was. I assume that since mapfile-write is reporting versions and formats correcting in the INFO: lines that the plugin is correctly installed.

Thanks in advance for any guidance :)

Cheers Gav

Corey Wallis

unread,
Jan 9, 2013, 11:32:20 PM1/9/13
to mapsfo...@googlegroups.com
Hi,

A couple of thoughts.

1. edit the osmosis script so that it allocates as much memory as
possibile to the java heap, generating map data files is a very memory
intensive task

2. use the type=hd parameter to store temporary data on the hard disk
drive so that there is less memory required. The down side is that the
conversion will take longer because the hard disk drive is the slowest
IO part in your computer.

For example:

osmosis --rb file="new-zealand.osm.pbf" --mapfile-writer
file="new-zealand.map" type=hd

Other than that I'm not sure, it has been a while since I worked on
our own conversion project.

Hope this helps.

-Corey
> --
>
>

Gavin Treadgold

unread,
Jan 9, 2013, 11:43:08 PM1/9/13
to mapsfo...@googlegroups.com
Thanks Corey.

1. I didn't see any memory/heap errors, and it did crash with errors pretty much straight away.

2. I tried type=hd, but that didn't make any difference. I'm working on an SSD, so I'm sure it isn't going to slow it down as much as it could on an older drive ;)

Thanks for your help.

Cheers Gav
> --
>
>

Corey Wallis

unread,
Jan 10, 2013, 12:35:10 AM1/10/13
to mapsfo...@googlegroups.com
Hi Gavin,

The memory stuff is usually the most common problem.

Investigating further I found this issue in the mapsforge repository:

http://code.google.com/p/mapsforge/issues/detail?id=354

The cause seems to be issues with changes to the internals of Osmosis
version 0.41

The resolution seems to be to use Osmosis version 0.40.1 or compile
the newest version of the plugin from the source repository.

Hope this helps.

-Corey
> --
>
>

Gavin Treadgold

unread,
Jan 10, 2013, 1:26:37 AM1/10/13
to mapsfo...@googlegroups.com
Hi Corey,

Thanks again for your time. Alas, reverting to 0.40.1 and/or increasing the memory (-Xms512m -Xmx1024m) didn't seem to change the behaviour.

Cheers Gav

Ludwig

unread,
Jan 10, 2013, 4:00:37 AM1/10/13
to mapsfo...@googlegroups.com
That original error you reported, with 

java.lang.AbstractMethodError: org.mapsforge.map.writer.osmosis.MapFileWriterTask.initialize(Ljava/util/Map;)V

is really exclusively related to 0.4.1 osmosis, if you still believe it happens with a previous osmosis version you are not picking up the right osmosis.




--



Gavin Treadgold

unread,
Jan 10, 2013, 4:32:23 AM1/10/13
to mapsfo...@googlegroups.com
Ludwig - well spotted! You're right, it appears that I was still running the brew-installed 0.41. I removed that and it appeared to compile fine :) I'm taking the file out to test it tomorrow, but so far it appears to have worked fine.

Thanks for your help. If it tests OK, who do I see about contributing the file to the download server?

Cheers Gav

Darcy Cowan

unread,
Jun 4, 2014, 4:45:52 PM6/4/14
to mapsfo...@googlegroups.com
Old thread I know but it's the only place I've found to directly address a mapsforge map for New Zealand (I can't even find the Aus/NZ one referenced initially here) so any help appreciated. Did this map get completed? Is it available for download somewhere? If nothing else I'll settle for the Aus/NZ one. I couldn't see it on the mapsforge downloads page but I'll accept that I may have been looking in the wrong place.

Thanks in advance for any replies.
Darcy

Tobias

unread,
Jun 4, 2014, 5:29:06 PM6/4/14
to mapsfo...@googlegroups.com

Darcy Cowan

unread,
Jun 4, 2014, 5:52:35 PM6/4/14
to mapsfo...@googlegroups.com
Thanks, I found that page about 5 mins after posting here. since it didn't initially register as mapsforge stuff (with me) I didn't look at it closely until it was too late. Thanks for the quick response, I'm downloading the map and will be able to check if it's compatible with the app I'm using later today. So I may still have questions :).

Thanks again, that was amazing response time.
Darcy

Emux

unread,
Jun 5, 2014, 2:30:41 AM6/5/14
to mapsfo...@googlegroups.com
There are 3 major vector maps download servers that cover the whole world:

- Mapsforge
- OpenAndroMaps
- AndroidMaps

OpenAndroMaps maps have extra features, like contour lines etc.
There are also excellent render themes at the site to use.

--
Emux
Cruiser - Atlas
Reply all
Reply to author
Forward
0 new messages