| 1 | OpenStreetMap data can be downloaded to a Garmin GPS: |
| 2 | * http://wiki.openstreetmap.org/index.php/OSM_Map_On_Garmin |
| 3 | |
| 4 | Some areas already have this done for you: |
| 5 | * http://wiki.openstreetmap.org/index.php/OSM_Map_On_Garmin/Download |
| 6 | |
| 7 | Download the data for the area that you're interested in. |
| 8 | |
| 9 | Easiest way for small areas is using JOSM & save it as filename.osm |
| 10 | |
| 11 | For larger files use http://wiki.openstreetmap.org/index.php/Osmxapi |
| 12 | |
| 13 | Calculate the bounding box (Decimal degrees, S & W are negative. Use GoogleEarth's 'Grid' View to help) |
| 14 | {{{ |
| 15 | wget -O filename.osm http://www.informationfreeway.org/api/0.5/*[*=*][bbox=min_long,min_lat,max_long,max_lat] |
| 16 | }}} |
| 17 | e.g. for Tanzania: |
| 18 | {{{ |
| 19 | wget -O tanzania.osm http://www.informationfreeway.org/api/0.5/*[*=*][bbox=29,-12,41,-1] |
| 20 | e.g. for Liberia: |
| 21 | {{{ |
| 22 | wget -O liberia.osm http://www.informationfreeway.org/api/0.5/*[*=*][bbox=-11.5,4.3,-7.35,8.6] |
| 23 | |
| 24 | or get a planet.osm file from: |
| 25 | * http://wiki.openstreetmap.org/index.php/Planet.osm |
| 26 | |
| 27 | This may need to be cleaned-up using UTF8sanitizer (needs to have Cygwin1.dll present): |
| 28 | * http://svn.openstreetmap.org/applications/utils/planet.osm/C/UTF8sanitizer.exe |
| 29 | {{{ |
| 30 | UTF8sanitizer.exe <filename.osm >fixed.osm 2>errors.txt |
| 31 | }}} |
| 32 | |
| 33 | Use mkgmap to convert this to be usable on the Garmin: |
| 34 | {{{ |
| 35 | java -jar -Xmx512M mkgmap.jar fixed.osm |
| 36 | }}} |
| 37 | |
| 38 | This will produce a file called 63240001.img. |
| 39 | This 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) |
| 41 | |
| 42 | For more help see: http://wiki.openstreetmap.org/index.php/Mkgmap/help |
| 43 | |
| 44 | If you get : |
| 45 | {{{ |
| 46 | Error at line 216, col 6 |
| 47 | Bad file format: c:\Temp\cut\63242591 |
| 48 | }}} |
| 49 | then open the file & remove the repeated header from the file! |
| 50 | |
| 51 | If you just get: |
| 52 | {{{ |
| 53 | Bad file format: c:\Temp\cut\63242591 |
| 54 | }}} |
| 55 | then open the file & convert to UTF-8 (Format menu in notepad++, if too large & it crashes, then use Cygwin/Linux: |
| 56 | {{{ |
| 57 | iconv -f ISO-8859-1 -t UTF-8 filename > output) |
| 58 | }}} |
| 59 | |
| 60 | If downloading the whole of the UK (from http://nick.dev.openstreetmap.org/downloads/planet/) then this is too large to process in 1 go, so do this: |
| 61 | {{{ |
| 62 | UTF8sanitizer.exe <uk-*.osm >fixed.osm 2>errors.txt |
| 63 | md cut |
| 64 | java -Xmx1024M -jar osmcut.jar 2 fixed.osm cut |
| 65 | }}} |
| 66 | cygwin: |
| 67 | {{{ |
| 68 | for i in cut/*; do iconv -f ISO-8859-1 -t UTF-8 "$i" > "${i}.utf8"; done |
| 69 | }}} |
| 70 | |
| 71 | {{{ |
| 72 | java -jar -Xmx1024M mkgmap.jar cut/*.utf8 |
| 73 | java -jar -Xmx1024M mkgmap.jar --gmapsupp 6*.img |
| 74 | }}} |
| 75 | |
| 76 | To update a gmapsupp.img, rename it as e.g. old.img, & build the new .img via: |
| 77 | {{{ |
| 78 | java -jar -Xmx1024M mkgmap.jar --gmapsupp latest.osm old.img |
| 79 | }}} |
| 80 | |
| 81 | 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): |
| 82 | * OSM.reg (attached) |
| 83 | NB MapSource 6141 - 6156 are broken - use 6137 for now |
| 84 | * see threads: http://www.poi-factory.com/node/15660, http://www.poi-factory.com/node/20054 |
| 85 | |
| 86 | To split off a smaller area from a larger osm file, use Osmosis: |
| 87 | * http://wiki.openstreetmap.org/index.php/Osmosis |
| 88 | {{{ |
| 89 | java -jar -Xmx512M osmosis.jar --rx horn_contours.osm enableDateParsing=false --sort --bounding-polygon file="sudan2pts.txt" --wx sudan_contours.osm |
| 90 | }}} |
| 91 | (2pts.txt files available from http://www.maproom.psu.edu/dcw/) |
| 92 | |
| 93 | To add Contour lines to the .osm files before converting to .img: |
| 94 | * http://wiki.openstreetmap.org/index.php/Srtm2Osm |
| 95 | e.g. for Liberia: |
| 96 | {{{ |
| 97 | srtm2osm -large -cat 500 100 -bounds3 "http://openstreetmap.org/?lat=6.47&lon=-9.35&zoom=8&layers=B00FT" -o liberia_contours.osm |
| 98 | }}} |
| 99 | e.g. for Tanzania: |
| 100 | {{{ |
| 101 | srtm2osm -large -cat 500 100 -bounds3 "http://openstreetmap.org/?lat=-6.89&lon=30.59&zoom=6&layers=B00FT" -o tanzania_contours.osm |
| 102 | }}} |
| 103 | e.g. for Darfur: |
| 104 | {{{ |
| 105 | UTF8sanitizer.exe <sudan.osm >fixed.osm 2>errors.txt |
| 106 | iconv -f ISO-8859-1 -t UTF-8 fixed.osm > sudan.osm |
| 107 | srtm2osm -large -cat 800 200 -bounds3 "http://openstreetmap.org/?lat=11.75&lon=27.37&zoom=7&layers=B000FTF" -o darfur_contours.osm |
| 108 | }}} |
| 109 | e.g. merge Kilimanjaro contours into Tanzania OSM: |
| 110 | {{{ |
| 111 | srtm2osm -step 50 -cat 1000 250 -bounds3 "http://openstreetmap.org/?lat=-3.2&lon=37.2&zoom=9&layers=B00FTF" -merge tanzania.osm |
| 112 | }}} |
| 113 | e.g. merge Table Mountain contours into South Africa OSM: |
| 114 | {{{ |
| 115 | srtm2osm -step 20 -cat 250 100 -bounds3 "http://openstreetmap.org/?lat=-33.93&lon=18.917&zoom=10&layers=B000FTF" -merge south_africa.osm |
| 116 | }}} |
| 117 | |
| 118 | Can also merge data afterwards using Osmosis: |
| 119 | {{{ |
| 120 | java -Xmx512M -jar osmosis.jar --rx darfur_contours.osm enableDateParsing=false --sort --rx sudan.osm --merge --wx outfile.osm |
| 121 | java -Xmx512M -jar osmcut.jar 3.5 outfile.osm cut |
| 122 | for i in cut/*; do iconv -f ISO-8859-1 -t UTF-8 "$i" > "${i}.utf8"; done |
| 123 | java -jar -Xmx512M mkgmap.jar cut/*.utf8 |
| 124 | java -jar -Xmx512M mkgmap.jar --gmapsupp 6*.img |
| 125 | }}} |
| 126 | http://wiki.openstreetmap.org/index.php/Topographic_maps_for_garmin_devices |
| 127 | |
| 128 | Alternative method for creating Contour maps which doesn't use OSM: |
| 129 | * http://home.cinci.rr.com/creek/garmin.htm |
| 130 | |
| 131 | If in the UK then can use .img files from Scottish Mountaineering Club: |
| 132 | * http://www.smc.org.uk/ContourMaps.htm |
| 133 | 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'. |
| 134 | |
| 135 | The gmapsupp.img from the SD card can then be copied-back to use elsewhere. |
| 136 | or |
| 137 | {{{ |
| 138 | java -jar -Xmx1024M mkgmap.jar --gmapsupp osm\6*.img contours\*.img |
| 139 | }}} |
| 140 | |
| 141 | Other sources of refined DEMs: |
| 142 | * http://translate.google.com/translate?u=http%3A%2F%2Fwww.mac-im-netz.de%2Fdateien%2Fmaps.html&hl=en&ie=UTF8&sl=de&tl=en |
| 143 | |
| 144 | ---- |
| 145 | [wiki:UserGuidelinesGISData] |