OpenStreetMap logo OpenStreetMap

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] (http://garmin.openstreetmap.nl/) 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.

Overview

My method for generating a suitable gmapsupp.img is thus:

  1. Download a OSM data extract in PBF format - Geofabrik
  2. Run osmosis to remove and contain only the relevant data wanted for the map.
  3. Create the map using mkgmap, using the default style.
  4. 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.

Detailed Process

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

Postscript

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.

Location: Southsea, Portsmouth, England, PO5 3DU, United Kingdom

Discussion

Comment from SomeoneElse on 24 July 2017 at 11:58

Thanks for writing this. There have been quite a few times over the years when people have asked how to get an OSM-based map onto a device with an unfeasibly small amount of storage, and there hasn’t been a good answer to point people at before now.

Comment from azubala on 29 July 2020 at 15:52

Thanks a lot for the post! Given http://garmin.openstreetmap.nl is not fully functional at the moment, this helped me a lot!

Comment from Michael T John on 4 August 2020 at 14:10

Thank you for this information, I found it very helpful. You should write more posts like this. I have a Garmin Edge 520. I update the maps on it using Garmin Express Updater, since it provides the latest updates for gps maps. It is also useful in resolving any errors that may occur in the device, or any Garmin device. I highly recommend it. https://garminexpressupdater.com

Comment from robbieonsea on 8 August 2020 at 21:43

NB These maps are not routable: add the –route option in the mkgmap command.

Log in to leave a comment