Sunday, August 8, 2010

Archive for the 'Garmin' Category

Archive for the 'Garmin' Category

Building Garmin Street File from Open Street Maps

Took a while, but this is the final installment of my epic 18-part series on free tools for making custom Garmin vector maps. I covered the free map compiler mkgmap in part 13, which converts OpenStreetMap data files (.osm) and Polish map files (.mp) to Garmin’s binary .img format. It’s command-line only, which can make it a pain to use. I wrote a simple Windows GUI for it a while back, but it wasn’t very good:

  • It required the compiler to be in the same directory as the data file.
  • It only worked for .osm files, not .mp files.
  • It assigned every compiled map the same default Map ID number (63240001.img), which meant that you could only use one compiled map at a time without having map conflicts.
  • It didn’t allow use of any of mkgmap’s more advanced options.

I’ve finally gotten around to fixing some of these issues, and now have a newer version of the GUI available; download it here (it comes with a copy of the mkgmap compiler), and unzip it into the folder of your choice. You’ll need to have Java 1.6 installed on your system; which you can check at the Java website. Run the executable:

supermkgmapgui

Use the button at upper-right to select the .osm or .mp file you want to compile. Hold the mouse cursor over each of the variable options to see pop-up help text describing their use, derived from mkgmap’s original documentation. The most important variables in the General Options section are:

  • Map ID Number, which should be a unique integer value between 65536 and 99999999 to avoid conflicts with other maps
  • Description, which identifies the mapset in the GPS unit

The other General options don’t seem to make that much of a difference.

Optimization options include Reduce Point Density with the Douglas-Peuckel algorithm to shrink the map size and speed up display; default is 2.6, and higher values simplify even more (mkgmap’s author recommends 10 as a good value). Turning Merge Lines on attempts to merge features together to simplify a map; haven’t noticed it making that much of a difference. For miscellaneous options, Draw Priority determines in what order vector maps are drawn; higher values mean the map is drawn later, on top of maps with lower values, obscuring those maps completely. Transparent maps have the higher priority of all, but you can see all parts of the vector map below them that aren’t obscured by the features in the transparent map (like a clear overlay on top of another map).

Once the options are set, pressing the “Compile” button creates a batch file called “compile.bat” that is then executed to compile the map code into the binary .img Garmin format; you should find the resulting file in the same directory as the map code file. Opening the “compile.bat” file in a text editor will show you the command line usage of mkgmap, and you can modify it there for further use if you like. You’ll find the compiled map in the same directory as the original map code file, with a filename that’s the same as the Map ID Number, and the file extension “.img”. See other posts in this series for info on how to upload this file to your Garmin GPS unit.

Reset” clears out the option values, “Help” takes you to this blog post, and “Exit” does what you’d expect.

This isn’t the full set of options supported by mkgmap; I’ve left out all of the routing options, and a bunch of others associated with creating full mapsets. I may wind up slowly adding some of those options on in the future, but this version should be good enough for basic map compilation. As usual, use at your own discretion/peril, and report any bugs to me.

No comments:

Post a Comment