Welcome to GPSFileDepot!

Main Menu

universal Garmin gmapi map creation on Linux box

Started by glendeni, January 03, 2015, 09:25:26 AM

Previous topic - Next topic


I've now successfully created "universal" Garmin "gmapi" map files on a Linux box and wanted to document the procedure here for others as there were a few glitches I had to solve. Most people here use Windows based proceures,  so I wanted to document a successful Linux process.

Background: this will only work for .img files produced by the OSM mkgmap compiler, not for .img files produced by cgpsmapper (which I did test).  I'm assuming here that someone is already familiar with the mkgmap compiler and has already used it to create .img and .tdb files (and routing .mdx/mdr.img  files if desired).

() On Linux box, you can produce a "gmapi" directory containing a "gmap" subdirectory which contains map data usable with BaseCamp on Windows PC (7-64bit tested) and OS-X Mac (untested) by  using the OSM program . A link to an older version with instructions is  - but there is a newer version can also utilize styling .TYP and/or routing .mdx/mdr.img files and it is hard to find so I've uploaded it as an attachment below.

() Put all the files in subdirectory, say "tiles", then run command -v -t tiles/MyMap.tdb -b tiles/MyMap.img -s tiles/STYLES.TYP -i tiles/MyMap.mdx -m tiles/MyMap_mdr.img tiles/*img
       where "MyMap.img" is "background" map name or number
       and the last argument can be multiple, such that all needed .img files (i.e. basemap, routing, etc) are included
       Optional arguments -s/-i/-m are only needed as appropriate for processing .TYP and .mdx/mdr.img files
       and I've included optional "-v" flag for more verbose output

() This creates directory MyMap.gmapi which has a subdirectory MyMap.gmap.  The latter should be installed on PC under a folder which varies with the OS.  The following should work
         for Windows XP: "C:\Documents and Settings\All Users\Application Data" folder (untested)
         for Vista and Windows 7: "C:\ProgramData\Garmin\Maps" folder (tested)
         for a Mac - am unsure as to how the files should be provided, but I think one can create a .zip or .tgz file of the gmapi directory and a Mac can open those for automatic installation

() The script does give a worrisome "Unknown Block: ..." message.  This has also been reported by others.  But no one has yet reported finding any resulting problem (and neither can I). Note: one message which does indicate an error is "Missing part:  ... in IMG-file", which occurs when a .img file is not readable (likely not created by mkgmap)

() I've tested WITH a styling TYP file and WITH routing files and WITH contour+stream .img files overlaid on a background map.  Everything (including routing) worked for me on a Windows 7 64-bit BaseCamp.  So all seems good



Just wanted to reinforce the fact that this will NOT work for img files produced by cgpsmapper.  I'd forgotten this myself and just spent a lot of time compiling with different cgpsmapper options to see if I could get one to work - but all failed.  FYI the version that I am using is dated Feb 2011.  I could not find a later/updated version.