Howto make your own Garmin device gmapsupp.img & Garmin BaseCamp Map [update for zsh]
Posted by Yabba on 4 September 2023 in English.Revised Script for usage in macOS 12+ with zsh:
#!/bin/zsh
echo "Download"
wget -t0 -c "http://download.geofabrik.de/europe/andorra-latest.osm.pbf"
wget -t0 -c "http://download.geofabrik.de/europe/austria-latest.osm.pbf"
wget -t0 -c "http://download.geofabrik.de/europe/belgium-latest.osm.pbf"
wget -t0 -c "http://download.geofabrik.de/africa/canary-islands-latest.osm.pbf"
wget -t0 -c "http://download.geofabrik.de/europe/czech-republic-latest.osm.pbf"
wget -t0 -c "http://download.geofabrik.de/europe/denmark-latest.osm.pbf"
echo "Convert"
./osmconvert --drop-version andorra-latest.osm.pbf -o=andorra-latest.o5m
rm -rvf andorra-latest.osm.pbf
./osmconvert andorra-latest.o5m -o=merged.o5m
rm -rvf andorra-latest.o5m
for FILE in ./*.osm.pbf; do ./osmconvert --drop-version $FILE -o=$(basename $FILE .osm.pbf).o5m; ./osmconvert $(basename $FILE .osm.pbf).o5m merged.o5m -o=merged_cache.o5m; rm -rvf $(basename $FILE .osm.pbf).o5m; mv -v merged_cache.o5m merged.o5m; done
echo "splitter"
## latest splitter Version r653 used
java -Xmx5G -jar splitter-r653/splitter.jar --output-dir=tiles --max-nodes=1200000 merged.o5m
echo "mkgmap"
## latest mkgmap Version r4910 used
## template 2022pn.typ used, use what you like :)
java -Xmx5G -jar mkgmap-r4910/mkgmap.jar --country-name=OSMMap --family-name="OSM map" --product-version=1 --bounds=bounds-latest --dem-interpolation=auto --make-poi-index --poi-address --unicode --index --split-name-index --gmapsupp --report-routing-islands -c mkgmap-r4910/examples/sample.cfg -c tiles/template.args 2022pn.typ --style-file=../ --check-styles --route --net --gmapi --add-boundary-nodes-at-admin-boundaries
echo "final clean up"
rm -rvf *latest.o5m
rm merged.o5m
cd tiles
rm -rvf *.osm.pbf
cd ..
rm -rvf 6*.img
rm -rvf ovm_6*.img
echo "The End"