blankblank blank




Converting Raster Maps To Garmin Vector Format With BMap2MP



I’ve posted previously about Moagu, my utility that converts raster map imagery into raster-format maps for some Garmin GPS units. Moagu creates a true bitmap image for Garmin units, with advantages (accurate map and photo reproduction) and disadvantages (slow display times). An alternative approach is to convert a raster image into many small vector polygons, then code those vector polygons as a Garmin-format map. While this approach can speed up display time dramatically, it can also be harder to get good results. There’s a commercial software package called Mapwel that can do this, but I’ve recently been made aware of a freeware program called BMap2MP that also converts raster images into vector polygons, and creates map code for those polygons in the .mp Polish map format. This code can then be compiled into Garmin .img map files using the free or paid versions of cgpsmapper. I’ve spend some time playing with this program, and comparing its results with comparable maps from Moagu.

BMap2MP comes compressed in .rar format; if your compression program can’t handle that format, try 7-Zip. BMap2MP is a command-line program, with program parameters set in an associated configuration text file. There’s a long list of adjustable parameters, most of which are described in an accompanying read-me file, to varying degrees of detail. But you should probably be at least somewhat familiar with some of the terms and processes involved in creating custom Garmin map files before tackling the read-me, since it assumes at least a basic knowledge of creating maps with custom TYP files. You’ll also need to know how to use cgpsmapper, which is also a command-line program.

Raster imagery needs to be in BMP format, and have a accompanying .map geocalibration file created by the GPS utility program OziExplorer ($95). The maximum size of the image that you can process depends on the amount of detail in the image. For the USGS topo map for my area, which contains a fair amount of topographic relief but minimal road/house detail, the largest image I could process at the native map resolution (2.4 meters/pixel) was about 2000 x 2000 pixels, or roughly 1/4 of the entire topo quad. For maps with less detail, you could probably use larger images; for maps with lots of small details, or aerial photos, the maximum size is likely to be smaller. Moagu automatically tiles large maps into smaller submaps to get around this issue.

Initial results with BMap2MP’s default configuration settings weren’t promising – much of the map detail is lost, contour lines are irregular and broken, and feature colors change depending on whether they’re on the green or white background. (Figure 1, a screenshot from a Garmin 60Cx GPSr). Modifying the parameters a bit (Figure 2), more detail is visible for some features, but other features disappear completely, and color changes are still an issue. Pre-processing the map colors before running the map through BMap2MP (Figure 3) brings back some detail, but with detail and color shifts still an issue. Removing the green color and modifying the map colors from their original settings gives better results for contour lines (Figure 4), but the purple road visible in Figure 3 has almost completely disappeared. Experimenting with the color parameters in the configuration file, I was unable to bring back the missing road without degrading the rest of the map.

default USGS_all_off USGS_clean_modded_nogreen USGS_modded_brown
Figure 1: BMap2MP, default settings Figure 2: BMap2MP, modified parameters Figure 3: BMap2MP, map colors modified before processing Figure 4: BMap2MP, green color removed and map colors modified before processing

Compare the best BMap2MP topo map with one created by Moagu:

USGS_modded_brown moagu
BMap2MP topo map Moagu topo map


The Moagu map shows more details, with better contrast than the BMap2MP map.

Viewing both mapsets at a lower zoom level (0.2-mile):

bmap2mp_0.2 moagu_0.2
BMap2MP Moagu


More detail is visible on the Moagu map, and contrast is better.

So why use BMap2MP instead of Moagu for a topo map? Because topo maps converted by BMap2MP have some significant performance advantages over Moagu maps:

  • Map compilation time is much faster with BMap2MP, as much as 5-10 times in some cases
  • BMap2MP file sizes are about a fifth the size of Moagu map files
  • Display speed is approximately 3 times faster for detailed maps like topo maps; for maps with less fine detail, e.g. maps with large areas of uniform color, the display speed differential can be even higher.
  • As you zoom in closer than the 300/500 ft. zoom levels in a Moagu map, it breaks up; that doesn’t happen with  BMap2MP maps
  • BMap2MP maps should display on most Garmin models; Moagu maps are limited to recent models in the eTrex Legend and Vista lines, Rino and Garmin 60CSx/76CSx model lines

So if you can live with less detail and poorer contrast, BMap2MP can be a good choice for many maps, especially those that don’t have a lot of small details like lines and points.

For aerial photos and satellite imagery, Moagu is usually going to create better Garmin map imagery. BMap2MP maps are limited to a maximum of 62 colors, vs. 254 for Moagu maps. In addition, BMap2MP’s vectorization process can remove substantial detail from the aerial photo, while Moagu is more faithful to the original. Here’s a comparison of a color aerial imagery of San Francisco’s Wharf district, processed with BMap2MP (61 colors) and Moagu (254 colors):

sfbmap2mp_finer sfutmcroppedresize sfmoagucropped
BMap2MP Original imagery, rescaled to same resolution as GPS Moagu

The limited color range of BMap2MP maps, and the degradation due to the vectorization process, results in substantial loss of detail. You can see that even more clearly if you blow up the maps by 3x:

6-12-2008-8.24.14 PM6-12-2008-8.33.40 PM6-12-2008-8.38.09 PM 6-12-2008-8.24.14 PM6-12-2008-8.33.40 PM6-12-2008-8.36.59 PM 6-12-2008-8.12.30 PM6-12-2008-8.20.59 PM
BMap2MP Original imagery, rescaled to same resolution as GPS Moagu


On the flip side, the reduced level of detail in the BMap2MP imagery also means that they will display about 2-3 times faster than the Moagu imagery.

If you want to experiment with creating Garmin maps with BMap2MP, but don’t want to hassle with the command-line or text configuration file, and/or don’t have OziExplorer for calibrating the map imagery, I’ve added a GUI front-end utility to Moagu that makes BMap2MP easier to use. This utility will:

  • Automatically create a BMap2MP-compatible calibration file from a standard GeoTiff (e.g. a topo map downloaded from the USGS Seamless Server), or any image with a worldfile in latitude/longitude/WGS 84
  • Remove the green color from topo maps if desired, and set the topo color scheme for best results
  • Sets parameters automatically for image type (topo or general), but also lets you modify the parameters in a GUI, and writes the configuration file automatically
  • Sends the map code to cgpsmapper to be compiled automatically, with the option to send it to your GPS

The demo version of Moagu limits you to converting a 500 x 500 pixel image using BMap2MP, while the full registered version lifts this size restriction; download a copy here. Read the help file for more info, but even with the simplified interface, it may take you some time to get results you’re happy with. There’s also a sample set of maps of the Moscow area created using BMap2MP; page is in Russian, but click on the first link to download the full set of map files installable in MapSource, and click on the second list to get a single sample map.

BTW, if you’ve tried Moagu before, the latest version is a lot easier to use than the earlier releases, and most of the bugs have been fixed.






Looking for something else? Enter some keywords below, then click "Search".    




16 Responses to “Converting Raster Maps To Garmin Vector Format With BMap2MP”


  1. 1 Marek L.

    It doesn’t work on my computer. I prepared BMP using OziExplorer’s “Save Map to Image File” item from menu. I have MAP file for it, but BMaP2MP still returns “File format error”. How did you get your BMP file from OziExplorer?

  2. 2 BMaP2MP

    2 Marek L.:
    You can get “File format error” if your MAP file doesn’t contain an “OziExplorer Map Data File” string in the very first line.

    2 All:
    BTW, Moscow region map was made with manual color settings instead of automatic settings.

    For scanned topo maps (with limited number of colors) manual settings (IndexColors=1 and all colors manually listed at the end of cfg file) usually allow to get much better results (with retaining of all necessary predefined colors).

    For aerial photos (with many colors) automatic mode (IndexColors=3) could be better approach. To retain as much details as possible all filters should be switched off but this can lead to worse performance and larger file size. You need to vary IndexColors3Threshold= and DropSmallColors= parameters to find better result in every case of using of automatic mode.

  3. 3 Leszek Pawlowicz

    Thanks for your comments – BMaP2MP is a nice utility, very clever, and better than my Moagu program for many graphical maps.

    I didn’t discuss the creation of custom colors because that was a bit too technical for the post. I hope to look at that for USGS topo maps in the near future.

  4. 4 Leszek Pawlowicz

    I did what you did, exporting a map, and then opening it directly with BMaP2MP; now that I’ve added a BMaP2MP utility to Moagu, I don’t need to do that anymore.

    If you haven’t seen it already, the author of BMaP2MP has posted a possible solution to your problem as a comment.

    https://freegeographytools.com/2008/converting-raster-maps-to-garmin-vector-format-with-bmap2mp#comments

  5. 5 Thomas

    BMap2MP works very well!

    Very handy program that fits nicely into Moagu!

    /Thomas

  6. 6 Thomas

    When uploading 2 maps made by Moagu using BMap2MP the colours in the one of the maps is off.

    But when I only upload 1 map to my gps it shows fine.

    Any workaround?

    /Thomas

  7. 7 Leszek Pawlowicz

    I suspect the reason is that each map has its own separate color palette created by BMaP2MP, and if you load in two maps, the Garmin only uses one of the palettes. No fix for that now, but I’m working on an upgrade that may help with that problem.

  8. 8 BMaP2MP

    The only way (known to me) to upload any two (or more) different maps converted separately is to make them as two (or more) different families in Mapsource with own TYP file in each family. By default TYP file prepared by BMaP2MP is made with no Family ID (FID=0) and it is applied to any map which is not a part of any family. So you cannot use more than one TYP file which is not bound to any family.

    If source bitmaps to upload have very similar colors then another approach could be to use fixed manual color settings for conversion of all of them. In such a case all TYP files will be same.

  9. 9 BMaP2MP

    Example map of Moscow area was moved to the new address (still in Russian):
    http://rock-et-al.webhost.ru/ArbaletMO/

  10. 10 Lisandro

    I’m looking for a program that do the opposite… Convert a vector IMG garmin map, to raster images for use with google maps.

    Do you know any program that can do this? Thanks in advance!

  11. 11 Leszek Pawlowicz

    The only method I can think of is to open the map in MapSource, use a screen capture program to “grab” the map image, then convert it to Google Maps tiles. Slow, tedious, inaccurate, and for original Garmin maps, probably a violation of the terms of use.

  12. 12 Fernando Abilio

    Bmap2MP does not work on my windows XP pro sp3, why? sorry, I would like to make it work, but it doesn’t, please help.

  13. 13 Leszek Pawlowicz

    Sorry, I can’t give detailed help on problems you might be having on your system with BMaP2MP. You might try contacting the author.

  14. 14 Co?kun O?uz Naml?

    Iâ??m looking for a program that do the opposite. Convert a raster images IMG garmin map. Do you know any program that can do this? Mapwel or Moagu.

  15. 15 Leszek Pawlowicz

    Moagu will convert a raster image into a Garmin map; display speed will be slow, but it does work. MapWel will need to vectorize the image first, and with limited color images with sharp contrast, the results can be reasonably good, and display speeds much faster than with Moagu.

  16. 16 ???????

    Hi mr. Pawlowicz,

    I am tring to combine roads with the vectorized images. By know I am not quite sure can MapWel maps be combined with roads as bmap2mp’s! I have tried a few maps but the result was awful. Probably you could understand me better from my pictures here http://forum.offroad-bulgaria.com/showthread.php?t=39045&page=2. I am interested can Moagu “mp” file be combined with roads and have you thought about this idea? :)

    Kind Regars,
    asterix

Comments are currently closed; feel free to contact me with questions/issues.