If you are an owner of a Garmin 520 device, you may have discovered the device has the capability to use custom maps in the standard Garmin .img format. Unfortunately the device has quite limited internal storage (up to around 100MB) and no external SD card capability.
Storage space can be increased by removing the default Basemap and maps of your choice (e.g. your local area) can be acquired via the excellent OSM Garmin Maps website.
Further information about doing this can be found via these blog posts:
However consider the needs of the long distance cyclist - such as a participant in London Edinburgh London, the premier Audax UK event - in this scenario the above available maps needed to cover the area being travelled will be too big to fit on this device.
One can use OSM data directly and process the data yourself using Open Source tools to generate a gmapsupp.img file that covers your area of interest. My operating system is Debian Linux so the tools needed are available, of a modern enough version and easy to install via the standard operating system 'apt-get' manner:
Those using Windows or Mac OS's can run these tools but installation is normally more intricate and one will need to refer to the individual websites for specific instructions.
My method for generating a suitable gmapsupp.img is thus:
- Download a OSM data extract in PBF format - Geofabrik
- Run osmosis to remove and contain only the relevant data wanted for the map.
- Create the map using mkgmap, using the default style.
- Transfer to your Garmin device and enjoy.
All these steps can be easily scripted to be able to run with different parameters, such as adjusting the data being used or for a newer dataset.
Note if you run mkgmap directly on an Great Britain extract, the resultant map is 220MB and thus too big to fit on a 520 device. Hence the osmosis commands are used.
Here are my osmosis and mgkmap commands in shell script with approximate timings of the operations on my desktop PC (1.4GHz).
export myPBF="great-britain-latest.osm.pbf" export poi_tags="amenity=toilets,fast_food,cafe,pub,shelter shop=convenience,supermarket,bicycle" osmosis \ --read-pbf "$myPBF" \ --tf accept-ways \ highway=* \ waterway=river,canal \ railway=rail,preserved \ natural=water landuse=reservoir \ $poi_tags \ --tf reject-ways highway=path,footway,track,bridleway,service \ --tf reject-relations \ --used-node \ --write-xml ways.osm # ~15 mins osmosis \ --read-pbf "$myPBF" \ --tag-filter accept-nodes place=* natural=peak $poi_tags \ --tf reject-nodes place=isolated_dwelling,farm \ --tf reject-ways \ --tf reject-relations \ --write-xml nodes.osm # ~2 mins osmosis --read-xml ways.osm \ --rx nodes.osm \ --merge \ --write-pbf \ reduced.pbf # ~3 mins mkgmap-splitter reduced.pbf # ~1 minute mkgmap --index --gmapsupp 63240*pbf # ~4 minutes
The resultant gmapsupp.img file is 77MB big, so fits easily on a Garmin Edge 520 device and can be transferred to the device by a file copy to the usual "Garmin" folder location on the device.
A copy of this specific gmapsupp.img is on Dropbox
Alternative strategies for creating a smaller map file could be to define a smaller data area via a simple bounding box or a more complex polygon or trying to customize the mkgmap style rules but I haven't tried these.
I will be participating in LEL next week - wish me luck :), but I will be using my trusty Garmin eTrex 20 - which having 2Gb internal storage - with the free standard map provided by https://talkytoaster.com - as per my normal outdoor cycling and walking (and on the side OSM surveying) activities.
I generated this mainly for a good friend who has a 520 device, but hopefully the above example will be useful for others to use directly or tailor this process for their needs.