From OpenStreetMap Wiki
< Mkgmap‎ | help
Jump to: navigation, search


Last Update: Jan 13th, 2010.

Bleeding edge: On github:

pyMkgmapGarmin is a script for mkgmap, written in Python. It supports multi-threading, intelligent building, and information storage.

Features (more precisely):

  • multi-threading. This makes generation of multiple maps faster if your CPU has more than one core.
  • intelligent building: Maps already generated won't be generated again if they did not change in the meantime. Means: If you have built maps for Switzerland, Germany and France, you can easily generate a new one with additionally Liechtenstein and only the latter will have to be built. This may save lots of time. (Like if you think, after building maps for a whole day, «wait, didn't I forget my own country in my map file?»)
  • information storage: The script will remember what country name and language abbreviation you've entered for your map files.
  • .maplist files: Can be passed as argument. Every line is meant to contain the file name of a .osm.bz2 file. For example switzerland.osm.bz2, liechtenstein.osm.bz2, germany.osm.bz2 and france.osm.bz2 are listed in the file mymap.maplist (each on a single line), and instead of passing all maps you wish to generate simply pass mymap.maplist.
  • geonames: Geonames will automatically be used.

For more information please refer to the mkgmap-README.txt included in the archive.

Example invocation:

$ python switzerland.osm.bz2 liechtenstein.osm.bz2 austria.osm.bz2

Download mkgmap-garmin (Jan 2011)
Project web page

.maplist file

The map names can be written into a file like mymap.maplist:


Then we can call it with this command (useful for bigger map collections):

$ python mkgmap.maplist

Command-line options

See the --help flag. (When making the .py file executable with chmod u+x you can execute it as shown below.)

$ ./ -h
Read settings: /data/workspace/pyMkgmapGarmin/config.xml
Usage: [options] [.osm.bz2 files] [.maplist files]
        .osm.bz2 files
                You can get them from e.g. 

        .maplist files
                Plain text files with a map filename on each line.
                Will add the maps given there to the list.

  -h, --help            show this help message and exit
  --nogeonames          Do not use geonames file for city entries. (Is
                        otherwise downloaded automatically if not available)
  --noreuse             Do not re-use already compiled images, also if they
                        are identical
  --backup              Create a backup of all settings. TODO (not yet
  -s FSTYLE, --style-file=FSTYLE
                        Optional style file (directory or zip)
  -t FTYP, --typ-file=FTYP
                        Optional TYP file
  -f SFAMID, --family-id=SFAMID
                        Optional family ID (shall match with TYP file)
  -n IMAXNODES, --max-nodes=IMAXNODES
                        Maximum nodes per map segment
                        Optional mkgmap configuration file (the --read-config=
                        option passed to mkgmap

Multilayer Map

/ Create multilayer maps