Version 24 (modified by Fran Boon, 10 years ago) ( diff )


Garmin Base Map

OpenStreetMap data can be downloaded to a Garmin GPS:

Some areas already have this done for you:

Download the data for the area that you're interested in.

Easiest way for small areas is using JOSM & save it as filename.osm

For larger files use

Calculate the bounding box (Decimal degrees, S & W are negative. Use Google Earth's 'Grid' View to help)

wget -O filename.osm*[*=*][bbox=min_long,min_lat,max_long,max_lat]

e.g. for Tanzania:

wget -O tanzania.osm*[*=*][bbox=29,-12,41,-1]

e.g. for Liberia:

wget -O liberia.osm*[*=*][bbox=-11.5,4.3,-7.35,8.6]

or get a planet.osm file from:


This may need to be cleaned-up using UTF8sanitizer


NB Can ignore errors in other apps

apt-get install libmysqlclient-dev
svn co
cd C
./UTF8sanitizer <filename.osm >fixed.osm 2>errors.txt


Needs to have Cygwin1.dll present


Use mkgmap to convert this to be usable on the Garmin:

java -jar -Xmx512M mkgmap.jar fixed.osm

This will produce a file called 63240001.img. This can be copied to the CF card as Garmin/gmapsupp.img (Put the Garmin into 'Mass Storage' mode to get it to act as a CF card reader)

For more help see:


If you get :

Error at line 216, col 6
Bad file format: c:\Temp\cut\63242591

then open the file & remove the repeated header from the file!

If you just get:

Bad file format: c:\Temp\cut\63242591

then open the file & convert to UTF-8 (Format menu in notepad++, if too large & it crashes, then use Cygwin/Linux:

iconv -f ISO-8859-1 -t UTF-8 filename > output)


If downloading the whole of the UK (from then this is too large to process in 1 go, so the file needs splitting.

New, untested method:

Old, tested method:

UTF8sanitizer.exe <uk-*.osm >fixed.osm 2>errors.txt
md cut
java -Xmx1024M -jar osmcut.jar 2 fixed.osm cut


for i in cut/*; do iconv -f ISO-8859-1 -t UTF-8 "$i" > "${i}.utf8"; done
java -jar -Xmx1024M mkgmap.jar cut/*.utf8
java -jar -Xmx1024M mkgmap.jar --gmapsupp 6*.img

To update a gmapsupp.img, rename it as e.g. old.img, & build the new .img via:

java -jar -Xmx1024M mkgmap.jar --gmapsupp latest.osm old.img


The map can be made visible in MapSource using a .reg file like this one (copy the 6*.img & the 6*.tdb to c:\garmin\osm):

  • OSM.reg (attached)

NB MapSource 6141 - 6156 are broken - use 6137 for now



To split off a smaller area from a larger osm file, use Osmosis (NB Need Osmosis-0.35 since Srtm2Osm only support API 0.5 currently!):

(2pts.txt files available from


To add Contour lines to the .osm files before converting to .img:

Running on Linux:

  • currently fails: "Cannot open assembly 'Srtm20sm.exe': No such file or directory."
    apt-get install mono-runtime libmono-corlib2.0-cil libmono-system-runtime2.0-cil libmono-system2.0-cil libmono-i18n2.0-cil libmono-corlib1.0-cil
    cd Srtm2Osm
    mono Srtm20sm.exe

e.g. for Haiti:

srtm2osm -large -step 25 -cat 250 100 -bounds1 17.884659 -74.668579 20.231275 -71.6584 -o haiti_contours.osm
osmosis --rx haiti_contours.osm enableDateParsing=false --sort --rx haiti.osm --merge --wx outfile.osm
osmosis --read-xml-0.5 haiti_contours.osm enableDateParsing=false --sort-0.5 --read-xml-0.5 haiti.osm --merge-0.5 --write-xml-0.5 outfile.osm
java -jar -Xmx2048M mkgmap.jar outfile.osm
java -jar -Xmx1024M mkgmap.jar --gmapsupp 6*.img

e.g. for Liberia:

srtm2osm -large -cat 500 100 -bounds3 "" -o liberia_contours.osm

e.g. for Tanzania:

srtm2osm -large -cat 500 100 -bounds3 "" -o tanzania_contours.osm

e.g. for Darfur:

UTF8sanitizer.exe <sudan.osm >fixed.osm 2>errors.txt
iconv -f ISO-8859-1 -t UTF-8 fixed.osm > sudan.osm
srtm2osm -large -cat 800 200 -bounds3 "" -o darfur_contours.osm

e.g. merge Kilimanjaro contours into Tanzania OSM:

srtm2osm -step 50 -cat 1000 250 -bounds3 "" -merge tanzania.osm

e.g. merge Table Mountain contours into South Africa OSM:

srtm2osm -step 20 -cat 250 100 -bounds3 "" -merge south_africa.osm

Can also merge data afterwards using Osmosis:

java -Xmx512M -jar osmosis.jar --rx darfur_contours.osm enableDateParsing=false --sort --rx sudan.osm --merge --wx outfile.osm
java -Xmx512M -jar osmcut.jar 3.5 outfile.osm cut
for i in cut/*; do iconv -f ISO-8859-1 -t UTF-8 "$i" > "${i}.utf8"; done
java -jar -Xmx512M mkgmap.jar cut/*.utf8
java -jar -Xmx512M mkgmap.jar --gmapsupp 6*.img

Alternative method for creating Contour maps which doesn't use OSM:

If in the UK then can use .img files from Scottish Mountaineering Club:

To merge these with the OSM data, ensure both Maps are visible in MapSource, select all the segments (using the 'Map Tool') from each in turn, then 'Send to Device'.

The gmapsupp.img from the SD card can then be copied-back to use elsewhere. or

java -jar -Xmx1024M mkgmap.jar --gmapsupp osm\6*.img contours\*.img

Other sources of refined DEMs:


Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.