Mkgmap (see the wiki page) is a very useful and free command-line utility for making map files for GPS devices. It is discussed in the GPS section for two main functions - converting an Osm file into an Img file (described in the creating maps guide), and combining multiple Img files into one big Img file (described in the combining maps guide). There are lots of other things that mkgmap can do too, including complicated style files and other configuration options, but these two are the functions which I use most.
The tool works great, but it's command line only, so you have to remember the command line switches and if you can't remember them you have to look in the help file. And you can't make a simple shortcut to it because all the filenames have to go in the command. So what you see here on this page is just a front-end to mkgmap, it's just another way to call it. You still need to download a copy of mkgmap separately from this Gui program.
This frontend is based on java, so you'll need a java runtime (at least version 5) in order to run it.
Note that mkgmapgui is now at version 1.1 as displayed in the window title bar. Version 1.1 brings the option to choose a map number for the conversion.
Runnable code plus source code (36 kb)
There isn't any installation, you just need to download and save this jar file. But you do need to separately download and unpack the mkgmap code, which you can find at the wiki page. You need to extract the file
mkgmap.jar and save that somewhere.
You can start this gui from the command line, or you can make a shortcut to it. Note though that in order to run mkgmap properly you need to allocate a lot of memory to it, and because mkgmap gets called by this Gui, you need to allocate a lot of memory to this Gui too. Fortunately you can put this parameter in the shortcut to the Gui so that it becomes automatic. The command to start it looks like this:
java -Xmx512M -jar mkgmapgui_1.1.jar downloads/mkgmap
There are four parts to this command, as follows: Firstly you call
java, because both this Gui and mkgmap itself use java. Next is the parameter
-Xmx512M, which tries to allocate 512 MB of memory to the program. This is a lot, but it's needed by mkgmap to do all the conversions. If you don't do this you may (depending on the map size) get exceptions when the program runs out of memory. Thirdly you need the parameters
-jar mkgmapgui_1.1.jar to reference where you stored this gui jar file. And lastly you can give the path to where you stored the
mkgmap.jar file, as the gui needs to be able to find the main program. You can either give the file itself or the directory it's in. In this example the mkgmap.jar file has been saved in the directory downloads/mkgmap/ so this directory is the last parameter given.
This basic screenshot shows the gui and the two options - conversion on the left side and combination on the right side. It allows either a single osm file or a list of img files to be selected, and then the appropriate function to be started. The output file is also selected with a normal file dialog.
You don't have to put anything in the "map number" field, but sometimes it's necessary. If you want to combine two img files together, it turns out that mkgmap requires that the img files have different map numbers. Img files with duplicate map numbers are just ignored by mkgmap without giving a warning :( So this option was added in version 1.1 to let you choose which map number (from 1 to 99999999) to use for the img file generation. I don't know of a way to change the map number of an img file which has already been created though.
There's another partially implemented GUI for mkgmap from freegeographytools.com which allows you to just do the conversion step. However it's rather limited in its functionality, doesn't allow you to select the output file, or warn you of overwriting, or give any feedback whether the process is running or completed, and its resizing behaviour is very primitive. Plus it only runs on windows and is closed source. Still if you want more information it's at freegeographytools.com/2007/converting-openstreetmap-data-into-gpx-or-garmin-img-format.
Update: Leszek has now (July 2010) updated this gui to allow many more options and remove some of the restrictions (but it's still closed source and still windows-only). The updated version is at freegeographytools.com/2010/free-tools-for-custom-garmin-vector-maps-xviii-full-gui-for-mkgmap-compiler but the download (called supermkgmapGUI) is oddly at a generic file-sharing site, so hopefully it's not been trojaned on the way. Also the new download includes a copy of the (open source) mkgmap within its zip file, but the legality of including GPL'd code within a closed source derivative work, seems extremely questionable, especially when the GPL license information has been removed.
There was another attempt to start a gui for mkgmap called "DoMyMaps", but according to the openstreetmap.org wiki the creator Lao has withdrawn it and suspended activity in 2009.