
This page details how to create map files from openstreetmap data for use with your GPS receiver. Firstly, however, it's wise to check that somebody else hasn't already done it for you. Follow the instructions in the downloading maps and combining maps pages to see if that will suffice - if so, you don't need to create your own.
If you do need to create your own map, you can follow the instructions here, taken from the mkgmap page.
The first step is to extract the data from openstreetmap and save the data locally in osm format. There are a few different ways to do this, but the easiest way is using their URL api from the command line:
wget http://www.informationfreeway.org/api/0.6/*[bbox=11,47,11.5,47.5] -O data.osm
This complicated-looking command is simply a request for a URL, using the wget tool - if you haven't got this then you can just paste the URL part into your browser address bar and save the resulting file. The area to extract is defined by the bbox= part - giving the west, south, east and northern limits of the bounding box in degrees. Here the box goes from 11°E to 11.5°E and 47°N to 47.5°N as an example. Depending on the size of your bounding box, the resulting osm file can be very large indeed (easily several hundred megabytes) and can take some time to download, so check your area before starting the extract.
If this works, you should have a file called "data.osm" (or whatever you called it) saved on your computer. If it doesn't work, check the api number (currently 0.6) and change it if necessary to the latest version. The next step is to convert it to img format.
To do the conversion to img format, we will use the free java tool Mkgmap which we already saw in the combining maps section. If you haven't already downloaded mkgmap, you can get it following the instructions given there.
To convert the osm file into img format (and thereby shrink its size considerably!), call the mkgmap program as follows:
java -Xmx512M -jar ~/download/mkgmap.jar data.osm
This calls the mkgmap jar file (stored in the download directory in this example) and passes it the osm file data.osm. The parameter "-Xmx512M" is an optional parameter to increase the amount of memory allocated to the program. In practice this seems essential for any file of non-trivial size.
Because we didn't specify a name for the map here, we get a file with the default filename of 63240001.img - you will almost certainly want to rename this immediately to make it more meaningful.
Also, following the instructions in the downloading maps page, you will need to rename the file to gmapsupp.img for it to be recognised by the Garmin GPS receiver. Or you can use mkgmap again to combine several of your created maps into a gmapsupp.img file for transfer to the receiver.
In the software section there's a new tool to make calling mkgmap a little easier - you can select the file to convert using a normal file selection gui, and then press the button to call mkgmap. It also lets you select the filename for the output rather than being stuck with an 8-digit filename. The tool is called Mkgmapgui and is free.