OpenStreetMap

Howto make your own Garmin device gmapsupp.img & Garmin BaseCamp Map [update]

Posted by Yabba on 5 April 2022 in English. Last updated on 7 April 2022.

By this following scipts you get the “gmapsupp.img” for a lot Garmin devices and another file “OSM map.gmap” for the Garmin BaseCamp Application on macOS and Windows. I’m on macOS, for Windows use your own creativity or ask other competent people, please. The Linux way is very similar.

You need the latest Splitter from “http://www.mkgmap.org.uk/download/splitter.html” Get the latest Snapshot of mkgmap from “http://www.mkgmap.org.uk/download/mkgmap.html” If you like, choose a *.typ file of your choise or create your own. Some samples are in the downloadable files included.

And finally you need osmconvert. Get it from Gitlab:

#!bin/bash
wget -O - https://gitlab.com/osm-c-tools/osmctools/-/raw/master/src/osmconvert.c | cc -x c - -lz -O3 -o osmconvert

Get your desired regions from GeoFabrik http://download.geofabrik.de like:

#!bin/bash
wget -t0 -c http://download.geofabrik.de/africa/canary-islands-latest.osm.pbf
wget -t0 -c http://download.geofabrik.de/europe/poland-latest.osm.pbf
wget -t0 -c http://download.geofabrik.de/europe/spain-latest.osm.pbf
wget -t0 -c http://download.geofabrik.de/europe/germany-latest.osm.pbf

Check the GeoFabrik Website for the latest updates.

#!bin/bash
# https://forum.openstreetmap.org/viewtopic.php?id=2625&p=126

./osmconvert --drop-version canary-islands-latest.osm.pbf -o=canary-islands.o5m
./osmconvert --drop-version poland-latest.osm.pbf -o=poland.o5m
./osmconvert --drop-version spain-latest.osm.pbf -o=spain.o5m
./osmconvert --drop-version germany-latest.osm.pbf -o=germany.o5m

rm -rvf *.pbf

./osmconvert canary-islands.o5m poland.o5m spain.o5m germany.o5m -o=merged.o5m
#./osmconvert poland.o5m germany.o5m -o=merged.o5m

rm -rvf canary-islands.o5m poland.o5m spain.o5m germany.o5m

java -Xmx5G -jar splitter-r651/splitter.jar --output-dir=tiles --max-nodes=1200000 merged.o5m
 
#### Best for Garmin Basecamp
java -Xmx5G -jar mkgmap-r4897/mkgmap.jar --country-name=YabbaMap --family-name="OpenStreetmap mkgmap Yabba 2022" --product-version=99 --dem-interpolation=auto --make-poi-index --poi-address --unicode --index --split-name-index --gmapsupp -c mkgmap-r4897/examples/sample.cfg -c tiles/template.args osm.typ --housenumbers --style-file=../ --check-styles --route --net

#java -Xmx5G -jar mkgmap-r4897/mkgmap.jar -c mkgmap-r4897/examples/sample.cfg -c tiles/template.args teddy.typ --housenumbers --style-file=../ --check-styles --route --net

#java -Xmx5G -jar mkgmap-r4897/mkgmap.jar -c mkgmap-r4897/examples/sample.cfg -c tiles/template.args jbm.typ --housenumbers --style-file=../ --check-styles --route --net

#java -Xmx5G -jar mkgmap-r4897/mkgmap.jar -c mkgmap-r4897/examples/sample.cfg -c tiles/template.args jbmhb.typ --housenumbers --style-file=../ --check-styles --route --net

#java -Xmx5G -jar mkgmap-r4897/mkgmap.jar -c mkgmap-r4897/examples/sample.cfg -c tiles/template.args mapnik.typ --housenumbers --style-file=../ --check-styles --route --net

#java -Xmx5G -jar mkgmap-r4897/mkgmap.jar -c mkgmap-r4897/examples/sample.cfg -c tiles/template.args --housenumbers --style-file=../ --check-styles --route --net

### Type file for https://gravelmaps.de
#java -Xmx5G -jar mkgmap-r4897/mkgmap.jar -c mkgmap-r4897/examples/sample.cfg -c tiles/template.args 2022pn.typ --housenumbers --style-file=../ --check-styles --route --net


rm -rvf merged.o5m
cd tiles
rm -rvf *.osm.pbf
cd ..
rm -rvf 6*.img

The resulted files in this sample will have a - by today date - size from about 4GB. You will need free disk space from around >16GB for the whole process.

Discussion

Comment from ChristianA on 11 April 2022 at 06:10

Excellent, I’ve been looking for a guide like this, thanks!

How difficult is it to change the styling and/or what features that are included in the resulting img-file? For instance, Since I am often using my Garmin in the forest, I do not want the forests to be shown at att, since that is kind of the default state, so removing forests or change the style for them would be very useful…

Comment from Yabba on 11 April 2022 at 09:39

Thanks for your Feedback! Well, you’re laying your fingers into the part I still had no time/patience to cover. The documentation on how to create styles for the map you find at the splitter doc: https://www.mkgmap.org.uk/doc/index.html Some samples (OSM, Mapnik, …) are in the splitter ZIP-Archive.

Style Manual: https://www.mkgmap.org.uk/doc/pdf/style-manual.pdf

TYP Compiler: https://www.mkgmap.org.uk/doc/typ-compiler

You’re welcome to dig into and share your workflow. ;)

Cheers

Log in to leave a comment