blankblank blank

Archive for the 'Garmin' Category Page 3 of 13

Free Tools For Custom Garmin Vector Maps XIII: OSM Tools A

With the growth of OpenStreetMap data has come a number of tools to help in creating custom Garmin vector maps from it.

mkgmap: Takes OSM map data (in .osm format), and converts it to the binary Garmin .img format. More complete feature set (from the website):

  • Generates a map directly from a file saved from JOSM or from an extract of the main OSM planet file.
  • Converts several .osm files in one run of the program to create a map tile set.
  • Creates a .tdb file and an overview map that can be used to view the maps in MapSource or QLandkarte.
  • Creates a gmapsupp.img file that can be copied directly to an SD card.
  • Can also combine previously produced .img files into one gmapsupp.img file.
  • Create a .tdb and overview map from previously produced .img files.
  • The mapping between OSM features in the Garmin map can be customized.
  • Transliteration of characters to ascii where possible to enable viewing on low end devices or for international maps.
  • Character set can be specified for display on capable GPS devices.
  • Control over the zoom levels that any feature appears at.

And to this list I can add several additional useful features:

  • Java-based, so it’s multi-platform.
  • Also compiles Polish Map format files (.mp), produced by programs like GPSMapEdit and GlobGPS. Maps compiled this way don’t have the ID/copyright “tag” included with the free version of cgpsmapper.
  • Support for routing; now supports .osm and .mp input formats. An earlier post talks about a website that has free routable Garmin street maps created this way.

For full documentation, including a list of all the optional command-line parameters, see the mkgmap wiki page. And here’s an old post on how to download the OSM data into the required .osm format.

mkgmap GUIs: mkgmap is a command-line only program; a couple of programs add a simple GUI to make using it simpler. A few years ago, I wrote a simple GUI called mkgmapGUI, Windows-only, that lets you specify a .osm file and compile it into a Garmin .img file. There’s another one, also called mkgmapGUI, that’s a bit better behaved (e.g. doesn’t let you overwrite an existing file), and is Java-based so it’s multi-platform. Neither supports any of the command-line options available for more sophisticated uses; I hope to update mine in the near future so that it will support at least some of them.

CreateIMG: A package that combines a number of tools (including mkgmap), and semi-automates the process of creating a routable Garmin street map for any country. Just set the country in the CreateIMG.bat file, run it, and the data will be downloaded automatically and compiled into a routable map. Default country is Italy; see the ReadMe.txt file for instructions on how to change the country, and other useful info.

Tile splitter: Chops a large .osm data file into smaller chunks that meet the space limitations for Garmin vector map tiles.

osm2mp: If you want to work with OSM data in the Polish Map text (.mp) format used by GPSMapEdit and other programs, osm2mp is a Perl script that performs the conversion. But GPSMapEdit also lets you use the compiled .img format as an input, and programs like MapTk and GPSMapEdit++ can convert .img files to the .mp format.

OSMWrangler: Mentioned briefly in an earlier post:

OSM files often contain not just road data, but also locations for amenities like restaurants, parks, doctors, theaters, prisons, etc.; a full list is available here. These will be converted by mkgmap into points on the Garmin map, regardless of whether you want them or not. osmwrangler gives you the option of removing whichever amenity types you don’t want in your map, and generating a new OSM file without them that you can then run through mkgmap. Oddly enough, it’s only currently available in command-line format.


OSMgenerate produces OSM files consisting of a standard grid of POIs or polygons (lines are not yet supported), each with a unique tag/key combination. It also produces a mkgmap style file. By compiling the OSM file using mkgmap in combination with the style file, you can generate a Garmin map with a grid of POIs or polygons, each with a unique hexadecimal Garmin type code, so that you can see what POI or polygon corresponds to any given Garmin type code.

The associated website also includes some useful additional information on using mkgmap.

Tomorrow, a few more OSM tools, specifically more comprehensive (and flexible) map creators.

Free Tools For Custom Garmin Vector Maps XII: TYP Tools B

Continued from yesterday, a few more tools for creating TYP files, custom symbology sets for Garmin vector maps.

GenTYP: Generates text code that can be compiled using cgpsmapper into a binary TYP file. Interface is somewhat cryptic if you don’t know TYP file terminology:


But there’s a decent help page here to walk you through the steps. The big plus here is that you are able to load a Windows 24-bit BMP image file, and convert it automatically into the XPM code format used for textual TYP files. So you can create your symbol design in a standard graphics editor, rather than relying on a simpler built-in editor. If I load in a symbol I created to depict an archaeological ruin site (here sized up from its original size of 16 x 16 pixels):


GenTYP converts it to XPM code format:


Web-based tools: Most of the TYP tools I’ve posted about are Windows-only, and none AFAIK work on Macs. But there’s a website with browser-based TYP creation and editing tools that are platform-independent; select the tool you want from the tabs at the top. Note: a bit quirky if you switch from one app to another; a browser refresh will usually fix that.

TYP Creator: Generates a TYP file from scratch, using graphics you upload:


TYP editor: Upload a previously-created TYP file, and you can modify symbol attributes (but you can’t edit the graphics directly).

TYP decompiler: Takes an uploaded binary TYP file, and decompiles it into text code, e.g.:


I wish there were a TYP compiler here as well, to convert text TYP code to binary format, but you can’t have everything.

Free Tools For Custom Garmin Vector Maps XI: TYP Tools A

One of the most useful capabilities in custom Garmin vector maps is the ability to create your own designs for point icons, lines and polygon fill patterns, and use them in addition to (or as substitutes for) Garmin’s standard symbology sets. You define these in a special file called a TYP file, created either directly or by using the cgpsmapper compiler to convert a text code fileinto a special TYP file. You then you associate that TYP files with the maps that use your custom symbology. Here’s an example from the cgpsmapper manual of a map that uses standard Garmin symbology (on the left), and custom symbology (on the right):


This capability gives you enormous flexibility in creating your own thematic Garmin vector maps. But designing and coding custom TYP symbology in standard cgpsmapper text format can be a major pain; you have to assign colors to ASCII symbols, then manually type out the color code symbols to generate the image a la ASCII art (XPM format). Here’s sample code for a fill pattern (from a sample file in the cgpsmapper distribution):


This is just two color, and simple symbols; if you wanted to make an elaborate, multi-colored fill pattern or point symbol, it could take a long time to create it. Fortunately, there are a number of free tools that can simplify the process.

cgpsmapper: AFAIK, this is the only program that fully supports all TYP file features, and you should have at least the free version installed on your system. The documentation includes a short section on how to create and compile type descriptions in text format into a TYP file, and how to incorporate these new symbols in your map code. The distribution also includes sample TYP code in the program directory (like the example above).

GarminColor (in French; free forum registration required to download it): Older Garmin handheld GPS units (like the GPSMap and eTrex models) allow for only 254 colors, 16 gray levels + 238 assorted colors. More recent models (like the Colorado/Oregon/Dakota series) allow for a larger color range, but if you’re designing custom symbols for use on all color Garmin units, you might want to stick with the more limited palette to insure that they’ll look the same on all the Garmin models. GarminColor shows you the allowed color palette, and gives you the hex code for every one:


Click on a color to get the the hex code; click on the button at upper-right to copy the hex code to the clipboard. The numbers  in the middle of the color bars represent the RGB decimal equivalents of the hex code. The color bars surround these numbers let you adjust the color by increments. The long bars at left/right select neighboring colors in the palette; the long bars at top/bottom select lighter/darker colors. The short bars above and below the numbers let you increase/decrease the red/green/blue values by values that conform to the palette restrictions.

MapToolkit (MapTk): Subject of yesterday’s post; in addition to its other features, like compiling maps, it also contains a built-in editor for custom points, lines and polygons:


I’m still struggling my way through decoding the MapTk manual, but it appears as though it creates/edits TYP files directly, without the need for the cgpsmapper compiler. And it looks as though the palette is limited to 254 colors, making it fully compatible with all color Garmin units.

TYPViewer: A very nice TYP file viewer; will take text TYP code or a compiled TYP file as input, and let you view the symbols and text code for those symbols:


You can modify the TYP code directly in the text window; a red button will pop up telling you to “click here” if you want to incorporate those changes, and you’ll see them implemented immediately in the symbol graphic at upper right. But if you double-click on a custom symbol listed at left, you’ll bring up a graphical symbol editor:


If you’re editing a binary TYP file, you can save it directly; if you’re working with a text file, you have the option of compiling it to a TYP file using cgpsmapper. There’s no help file, and the interface is completely in French, so you may need to spend some time with Google Translate to figure it out all the functionality. But I didn’t have too much trouble figuring out the basics using Google Translate (and my very rusty high school French). HT to csdf for this one.

A few more TYP tools tomorrow ….

Free Tools For Custom Garmin Vector Maps X: MapToolkit (MapTk)

Just found out about the MapToolkit program (aka MapTk) a few days ago, and I’m still puzzling my way through the PDF manual file figuring out how it works. But from the feature set described in the manual, it’s definitely worth a look:

  • Alternative to cgpsmapper for compiling .mp files; free of the copyright notice added by the free version of cgpsmapper.
  • Supports POI indexing (not supported in free version of cgspmapper).
  • Generates data/files required to install mapsets in MapSource and BaseCamp .
  • Graphical TYP file editor for customized point icons, lines and areas (more on that in the next post in this series) .
  • Analysis / decompiling of IMG-, TDB- and TYP-files
  • Modify transparency of existing .img files
  • Multiple GPX functions: Split GPX file with multiple types (points, tracks, routes) into multiple files, each with only one type; convert .mp file to GPX format and vice versa; simplify tracks, mask GPX files to fit into existing .mp files; etc.
  • And more ….


One major caveat: you’ll need to be fairly familiar with both the .mp Polish Map format language and the general functionality of the cgpsmapper (described in the cgpsmapper documentation) to be able to decode the MapTk manual and the program’s functionality; even then, it’s likely to be a bit of struggle. Regardless, the feature set looks strong enough that I’ll make that effort. Version available for Windows and Ubuntu Linux, plus a generic Python version that should work on any Linux distribution.

Free Tools For Custom Garmin Vector Maps IX: GlobGPS Helper

An earlier post in this series covered GlobGPS, a simple (and simple-to-use) Garmin vector map editor. GlobGPS has a built-in raster image calibrator, but the only calibration units accepted are latitude/longitude; if you have a map in UTM or some other projection, this can create calibration inaccuracies. For that matter, if you have a raster image that’s already georeferenced, e,g, GeoTiff, MRSID or BSB, it seems like a waste to have to re-georeference it again.

I’ve written a small program called GlobGPS Helper that will:

  • Open a raster image with embedded georeferencing data; supported formats are GeoTiff, ERDAS Imagine, MRSID and BSB.
  • Re-project the raster image to geographic/WGS84 (Plate Carree).
  • Save the image in the JPG format that GlobGPS requires.
  • Save a .cal file that GlobGPS can use to load and automatically geo-calibrate the file.
  • Give you the option to save the re-projected raster image in GeoTiff format.

Simple interface; just click the “Load Image …: button to select the desired georeferenced raster image, and the rest of the process is automatic:


In this example, I’ve loaded a BSB navigation chart (loading the file 13235_1.kap). GlobGPS Helper uses the GDAL library to re-project the image into Plate Carree projection, WGS84, saves the image in jpg format (filename shown above to the right of the “Raster Image Output” label), and also saves the .cal calibration file that GlobGPS uses to load the jpg image and calibrate it:


In housekeeping files, GlobGPS Helper automatically deletes the re-projected GeoTiff file generated from the original raster image; check the box to the left of “Don’t delete Plate Carree GeoTiff” if you’d prefer to save it (it would be called 13235_1_geo.tif in this example). All the rest of the data shown is for information purposes only. The Help button takes you to this post page; Exit does what you would expect. There’s some error-checking, but it may not be foolproof; if you hit a problem, let me know.

Download the GlobGPS Helper application here; unzip the entire folder to your location of choice, and run the executable from that folder.  As usual, verify the data before using it in your GPS, and use it at your own risk.

Free Tools For Custom Garmin Vector Maps VIII: Topo Process Tools

Over the past few years, Dan Blomberg has come up with a step-by-step process to generate high-resolution vector topographic maps (equivalent to 1:24K) for Garmin GPS units. There’s a multi-part tutorial describing the process on his GPS File Depot website, along with free downloadable maps created using this process by him and others. To simplify and automate some of the steps, he’s created a basic front-end called Topo Process. Feature list (from the website):

    • Transportation – Download and process the 2008 Census data automatically (2008 data downloaded added in v1.0.15)
    • Contours – uses FWTools to process the contours; also uses PostGIS; this is free and easy (GeoTiff Files Required)
    • GNIS – points of interest; just like the program gnis_process; works until the usgs changes the file names
    • water data – automatic parsing of the water data, read the directions in gray for how the folder needs to be organized
    • Forest Service – VERY VERY BETA; I wouldn’t use it (i do but in debug mode)
    • to .img – just point it to the folder with the .mp files and it’ll convert them all to .img

You’ll need to use the tutorial instructions to install all the required software packages (e.g. PostGIS, FWTools, cgpsmapper) before using the tool.


Currently written in VB6; Dan’s working on a version to be done in Java. I really need to move on from VB6 as well :).

Free Tools For Custom Garmin Vector Maps VII: MP/IMG File Analyzers And Modifiers

A random grab bag of utilities to analyze and modify Garmin Polish Map (.mp) text files.

GPS Map Manager: AKA ManejadorDeMapa; interface is in Spanish. A utility designed to analyze .mp files for issues, and fix them (from the website):

  • Eliminate invalid characters in Points of Interests (POIs) names
  • Fix letters and words in POI names
  • Find and fix duplicated POIs
  • Find and fix errors in POIs: unknown types, without coordinates at Level 0, etc.
  • Find and fix Roads without standard Route Parameters
  • Find and fix errors in Roads: with 1 or 0 coordinates, without coordinates at Level 0, etc.

imgdecode: Documentation on the binary Garmin .img map format, what you get when you compile a .mp file; includes some sample code for parsing the files.

LevelEditor: Available in the Files section of the Yahoo Map Authors forum. Appears to take an .mp file and let you modify the zoom level at which user-selectable feature classes become visible; no help file, so I can’t say for sure:


I can say that it sometimes will choke on a very large file.

mutaMap: Available in the Files section of the Yahoo Map Authors forum. From the enclosed readme.txt file:

MutaMap is an utility to convert from the ZipCodes, cities, regions and country index from Mapedit to the proper cgpsmapper format (CountryName=, RegionName=, CityName=, Zip=)

If in Opciones, “Reemplazar objetos sin CityIdx” is selected and the following fields are empty, MutaMap will add the parameters CountryName=, RegionName=, CityName=, Zip=, empty with no value (except in the ones where a valid cityidx value is asigned) to all the objects inside the .mp file, the exception will be when it find a City=Y where CityName= will be ommited.
If in MutaMap you put values to the fields, all the objects inside the .mp without a cityidx value will be asigned to the ones you entered of country, region, city, zip, if you only fill one field that value will be given to all the objects without a cityidx and the others will stay empty
If we leave the checkbox “Reemplazar objetos sin CityIdx” unchecked, the empty fields (CountryName=, RegionName=, etc) will not be added to the MP file, only the ones with a cityidx value.

All the CityIdx=x parameters inside the .mp will be replaced by the values in the tables [country],[regions] and [cities][ZipCodes], but with the propper cgpsmapper format (CountryName=, RegionName=, CityName=, Zip=)

Never used it, not even sure if it’s necessary any more (last update was in 2005).


ImgTool: A handy-looking tool that lets you load a binary Garmin .img file and …

  • Make it transparent (or non-transparent)
  • Change the draw priority
  • Change the MapSet name
  • Change the TYP file ID
  • Change the map name and description

In French, but I found most commands understandable as-is (and you’ve got Google Translate to help you out if you have a problem).


Free Tools For Custom Garmin Vector Maps VI: Map IDs, Splitters And Combiners

Some tools for handling Garmin .img and .mp files.

GMapTool: I’ve posted before about using GMapTool to break up a combined .img binary Garmin map file into its original segments, and also how it can identify the full names and geographical extents of Garmin map tiles. But you can also use it to join multiple .img map files into a single file, modify basic parameters in the binary file without decompiling it, strip out unwanted data (like routing and elevation data), and much more.

pGPSmap: From the website description …

  • Splits large map into a set of smaller maps
  • Merges holes in regions with regions’ bounds
  • Splits large regions
  • Splits large polylines

Haven’t used it, and as the website points out, only the first function isn’t performed directly by the cgpsmapper compiler. This was also written 6 years ago, when there might have been a substantial drawing speed increase by cutting a large map into smaller ones; not clear that it’s that useful any more.

MapExtract: Does the following (from the website description)

  • Decrypt simple crypted maps (if needed)
  • Convert img map file to polish format
  • Extract selected map window from large maps
  • Include or remove selected points, polylines and polygons
  • Extract or remove selected map levels
  • Convert any map object type to another
  • Change the map name and map ID
  • Convert map from polish to img format
  • Map preview – before and after any conversion
  • Send map to Garmin GPS (or set of multiple maps)
  • Tool to create intersection point of all streets from level0
  • Tool to split large maps automatically
  • Change map ID of IMG files

This is also an older utility (last version released 5 years ago), and there are other ways to perform most of these tasks.