Welcome, Guest. Please login or register.

Login with username, password and session length
Forums Search:  

Author Topic: universal Garmin gmapi map creation on Linux box  (Read 2086 times)


  • Mapper
  • ***
  • Posts: 80
  • Karma: 0
    • View Profile
universal Garmin gmapi map creation on Linux box
« on: January 03, 2015, 09:25:26 AM »
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 gmapi-builder.py . A link to an older version with instructions is   http://wiki.openstreetmap.org/wiki/Gmapibuilder  - 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
Code: [Select]
gmapi-builder.py -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

« Last Edit: January 03, 2015, 10:13:29 AM by glendeni »


  • Mapper
  • ***
  • Posts: 80
  • Karma: 0
    • View Profile
Re: universal Garmin gmapi map creation on Linux box
« Reply #1 on: January 18, 2017, 09:51:36 PM »
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.
« Last Edit: January 18, 2017, 09:53:42 PM by glendeni »