Mkgmap/help/How to create a map

From OpenStreetMap Wiki
< Mkgmap‎ | help
Jump to: navigation, search
Available languages — Mkgmap/help/How to create a map
· English · Nederlands · 日本語
Mkgmap
Help
Routing
i18n
Known issues
Development
Download maps


Introduction

If you want to load OSM data onto a Garmin GPS device, you can either download pre-compiled maps, or you can compile them yourself. This page describes the latter option. The maps produced support routing (for cars) and searching for addresses.

Pre-Requisites

You need to download the following software / tools:

Install Java Runtime Environment 1.7. Both mkgmap and splitter depend upon it.

Walkthrough

Download OSM data (.osm, .osm.pbf or .osm.gz) for a certain region. Mirrors offering extracts are listed here. Geofabrik and Cloudmade are good starting points.

Use splitter to split the raw map data into smaller pieces, called tiles. This is necessary because most of the downloaded region extracts are too big to be processed by mkgmap. For example:

$ java -jar splitter.jar us-northeast-latest.osm.pbf

The resultant tiles are named 6324xxxx.osm.pbf, where xxxx is 0001, 0002, 0003...

These tiles can be compiled into a map as-is, but the resultant map would lack addressing data (e.g. city or zip code). Addressing data comes from preprocessed bounds tiles, and you can either download them from mkgmap.org or create them yourself as described in Mkgmap/help/options#Using_preprocessed_bounds_for_the_address_index. Place the resultant files into a subdirectory named bounds.

Finally, you can use mkgmap to compile the tiles and bounding information into something comprehensible by a Garmin GPS.

$ java -jar mkgmap.jar \
    --route \
    --add-pois-to-areas \
    --bounds=bounds \
    --index \
    --gmapsupp \
    6324*.osm.pbf

This creates several files, including the coveted gmapsupp.img file. Copy this file onto the SD card used by the GPS. The details are listed here, but here's a quick refresher:

  • The SD card should be formatted as FAT32.
  • There should be a folder called "Garmin" at the root of the SD card.
  • The gmapsupp.img goes into the "Garmin" folder.

Tweak your map

You can use several options and the style files of mkgmap to tweak your map to your requirements. Read the following for details: