Mkgmap/dev

From OpenStreetMap Wiki
Jump to navigation Jump to search

Page about the development of mkgmap.

Subversion access

The following command will check out the main development branch of mkgmap.

svn co http://svn.mkgmap.org.uk/mkgmap/trunk mkgmap

Branches are created temporarily to perform larger pieces of work and appear in the conventional place in directories under branches.

Mailing list

There is a mailing list for mkgmap development. As there is only the one list you are welcome to post anything relating to mkgmap to it at present. If it ever becomes too high volume it will get split then based on the kind of traffic there is.

To join the list you should go to the mkgmap-dev list page.

Building

For details, see Mkgmap/dev/Building.

Once checked out you can use ant to build mkgmap. You need a java development kit (download JDK).

   cd mkgmap
   ant dist
   java -jar dist/mkgmap.jar

Note: to read maps in pbf format, you will also need protobuf.jar and osmprotobuf.jar.

Nightly development builds

The code from subversion is automatically built every day (as long as there have been changes). Click on the link below to see what is available.

daily snapshot directory.

You can always get the latest version from mkgmap-latest.tar.gz. Development versions haven't had a lot of testing but they probably work and will usually have more features than the current stable version.

Applying Patches

Patches (e.g. from the mailing list) can be applied using the "patch utility". The trick with patches is making the filenames that are in the patch, match the files in the current working directory (and below).

In the simplest case, you can say (on the Linux command line)

patch < patchfile

But often, it will complain that it can't find the patch and then you have to either change into a lower subdirectory, and/or use the -p option to patch to tell it to strip prefix directories from the patch filenames. E.g.

patch -p1 < patchfile


Enabling Debugging

Logging can be enabled with java system setting -Dlog.config :

-Dlog.config=logging.properties

Example logging.properties file:

# The default level FINE, WARNING, INFO, SEVERE 
.level=SEVERE
#handlers: java.util.logging.ConsoleHandler 
handlers: java.util.logging.FileHandler java.util.logging.ConsoleHandler 
# package or class name with .level appended and then the level
uk.me.parabola.imgfmt.level=INFO
uk.me.parabola.mkgmap.build.level=INFO
uk.me.parabola.mkgmap.main.Main.level=INFO
uk.me.parabola.mkgmap.main.MapMaker.level=INFO
uk.me.parabola.mkgmap.general.RoadNetwork.level=INFO
uk.me.parabola.mkgmap.general.MapLine.level=INFO
uk.me.parabola.mkgmap.osmstyle.level=INFO
uk.me.parabola.mkgmap.reader.osm.level=INFO
uk.me.parabola.mkgmap.reader.osm.xml.level=INFO
uk.me.parabola.mkgmap.reader.osm.RestrictionRelation.level=FINE
uk.me.parabola.mkgmap.reader.osm.Restriction.level=FINE
# For ConsoleHandler
java.util.logging.ConsoleHandler.level=WARNING
java.util.logging.ConsoleHandler.formatter=uk.me.parabola.log.UsefulFormatter
# For FileHandler
java.util.logging.FileHandler.level=FINE
java.util.logging.FileHandler.encoding=UTF-8
java.util.logging.FileHandler.formatter=uk.me.parabola.log.UsefulFormatter
java.util.logging.FileHandler.limit=20000000
java.util.logging.FileHandler.count=4
java.util.logging.FileHandler.pattern=mkgmap.log
java.util.logging.FileHandler.append=false

List of things to do

If you want to get involved in the development, then here are a few ideas for things that need doing.

Language improvements

This is an continuing effort. The characters that can actually be displayed depends on the particular GPS device. Therefore if you want a map that can be used by the largest number of people, we need to produce names that are in upper case ascii, but also allow the flexibility to make maps with other character sets for national maps.

So we need people to check character set rendering on their devices and to provide transliterations from character sets to ascii (or other character sets, the flexibility is there to do that). There is a internationalisation page for this with more information.

GUI

As mkgmap gets more sophisticated and gains more options the usefulness of a GUI increases for many people. I made a start on the gui branch, but it would benefit from someone who is more adept at writing GUI code helping out there.

How do I have to use this GUI? How to start it? --Willem1 13:32, 3 August 2009 (UTC)
There is an advanced GUI offered here: OSM_Composer

Installation and scripts to run

Installation and shell scripts / batch files to run the program would be very useful.

Bugfixing routing

Routing support is quite well by now (December 2012). Anyhow some problems are reported when routing over long distances. Experiment with this to find bugs in the code and help understanding unknown parts of the IMG format.