Changes between Initial Version and Version 1 of UserGuidelinesGISDataOpenStreetMapGarmin

09/10/10 13:40:23 (12 years ago)
Fran Boon



  • UserGuidelinesGISDataOpenStreetMapGarmin

    v1 v1  
     1OpenStreetMap data can be downloaded to a Garmin GPS:
     2 *
     4Some areas already have this done for you:
     5 *
     7Download the data for the area that you're interested in.
     9Easiest way for small areas is using JOSM & save it as filename.osm
     11For larger files use
     13Calculate the bounding box (Decimal degrees, S & W are negative. Use GoogleEarth's 'Grid' View to help)
     15wget -O filename.osm*[*=*][bbox=min_long,min_lat,max_long,max_lat]
     17e.g. for Tanzania:
     19wget -O tanzania.osm*[*=*][bbox=29,-12,41,-1]
     20e.g. for Liberia:
     22wget -O liberia.osm*[*=*][bbox=-11.5,4.3,-7.35,8.6]
     24or get a planet.osm file from:
     25 *
     27This may need to be cleaned-up using UTF8sanitizer (needs to have Cygwin1.dll present):
     28 *
     30UTF8sanitizer.exe <filename.osm >fixed.osm 2>errors.txt
     33Use mkgmap to convert this to be usable on the Garmin:
     35java -jar -Xmx512M mkgmap.jar fixed.osm
     38This will produce a file called 63240001.img.
     39This can be copied to the CF card as Garmin/gmapsupp.img
     40(Put the Garmin into 'Mass Storage' mode to get it to act as a CF card reader)
     42For more help see:
     44If you get :
     46Error at line 216, col 6
     47Bad file format: c:\Temp\cut\63242591
     49then open the file & remove the repeated header from the file!
     51If you just get:
     53Bad file format: c:\Temp\cut\63242591
     55then open the file & convert to UTF-8 (Format menu in notepad++, if too large & it crashes, then use Cygwin/Linux:
     57iconv -f ISO-8859-1 -t UTF-8 filename > output)
     60If downloading the whole of the UK (from then this is too large to process in 1 go, so do this:
     62UTF8sanitizer.exe <uk-*.osm >fixed.osm 2>errors.txt
     63md cut
     64java -Xmx1024M -jar osmcut.jar 2 fixed.osm cut
     68for i in cut/*; do iconv -f ISO-8859-1 -t UTF-8 "$i" > "${i}.utf8"; done
     72java -jar -Xmx1024M mkgmap.jar cut/*.utf8
     73java -jar -Xmx1024M mkgmap.jar --gmapsupp 6*.img
     76To update a gmapsupp.img, rename it as e.g. old.img, & build the new .img via:
     78java -jar -Xmx1024M mkgmap.jar --gmapsupp latest.osm old.img
     81The 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):
     82 * OSM.reg (attached)
     83NB MapSource 6141 - 6156 are broken - use 6137 for now
     84 * see threads:,
     86To split off a smaller area from a larger osm file, use Osmosis:
     87 *
     89java -jar -Xmx512M osmosis.jar --rx horn_contours.osm enableDateParsing=false --sort --bounding-polygon file="sudan2pts.txt" --wx sudan_contours.osm
     91(2pts.txt files available from
     93To add Contour lines to the .osm files before converting to .img:
     94 *
     95e.g. for Liberia:
     97srtm2osm -large -cat 500 100 -bounds3 "" -o liberia_contours.osm
     99e.g. for Tanzania:
     101srtm2osm -large -cat 500 100 -bounds3 "" -o tanzania_contours.osm
     103e.g. for Darfur:
     105UTF8sanitizer.exe <sudan.osm >fixed.osm 2>errors.txt
     106iconv -f ISO-8859-1 -t UTF-8 fixed.osm > sudan.osm
     107srtm2osm -large -cat 800 200 -bounds3 "" -o darfur_contours.osm
     109e.g. merge Kilimanjaro contours into Tanzania OSM:
     111srtm2osm -step 50 -cat 1000 250 -bounds3 "" -merge tanzania.osm
     113e.g. merge Table Mountain contours into South Africa OSM:
     115srtm2osm -step 20 -cat 250 100 -bounds3 "" -merge south_africa.osm
     118Can also merge data afterwards using Osmosis:
     120java -Xmx512M -jar osmosis.jar --rx darfur_contours.osm enableDateParsing=false --sort --rx sudan.osm --merge --wx outfile.osm
     121java -Xmx512M -jar osmcut.jar 3.5 outfile.osm cut
     122for i in cut/*; do iconv -f ISO-8859-1 -t UTF-8 "$i" > "${i}.utf8"; done
     123java -jar -Xmx512M mkgmap.jar cut/*.utf8
     124java -jar -Xmx512M mkgmap.jar --gmapsupp 6*.img
     128Alternative method for creating Contour maps which doesn't use OSM:
     129 *
     131If in the UK then can use .img files from Scottish Mountaineering Club:
     132 *
     133To 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'.
     135The gmapsupp.img from the SD card can then be copied-back to use elsewhere.
     138java -jar -Xmx1024M mkgmap.jar --gmapsupp osm\6*.img contours\*.img
     141Other sources of refined DEMs:
     142 *