GPS procedures

Introduction

This page is intended as a brief introduction to using a GPS and includes help for using a Garmin eTrex on Linux.

If you are looking for the procedure to convert OSM data to Garmin-format maps then scroll down!

Terminology

  • GPS coordinate: representation of a geographical location in numeric format, specified as degrees north of the equator and east of the Greenwich meridian (e.g. N40.829656,E-73.926198)
  • GPS receiver or just GPS: the equipment (e.g. Garmin eTrex Legend HCx) for receiving GPS data (e.g. the device’s current GPS coordinates, its current altitude)
  • point of interest or POI: a geographical location which is of general interest (e.g. the Kempinski Hotel Munich, the police station on the Boulevard du Palais on the Ile de la Cite, the Natural History Museum in London, the Volpetti Rosa pizzeria in Rome)
  • waypoint: a geographical location; this is normally a POI or a more personal point of interest (e.g. corner of School Street and Province Street in Boston, your friend’s house, the peak of Mount Everest, N52.524183,E13.412437)
  • map: data about a region; it includes locations of roads, altitude information, POIs
  • base map: a basic map that might come preloaded on the GPS; it is generally not deletable; the lack of detail on the map means it is pretty useless
  • Americas, Atlantic or Pacific Recreational: Garmin’s base maps
  • OpenStreetMap or OSM: a free worldwide map, “created by people like you”
  • route: a manually or automatically calculated set of instructions for getting from somewhere to somewhere created before a journey
  • manually calculated route: a route where the set of instructions is defined by a person. Typically, this involves creating a sequence of waypoints (perhaps at road junctions) or downloading from the internet a track that somebody else has traveled and using software to convert it from a track to a route
  • automatically calculated route: a route where the set of instructions is defined by a computer (e.g. MapSource, Google Maps, your GPS). Typically this involves requesting the computer to calculate a route from the start waypoint to the end waypoint (e.g. from Paris, possibly via Zurich to Prague or from home, possibly via the dentist’s surgery, to work)
  • track: location and time data created during a journey (e.g. now, at 4pm the device is at N52.52344,E13.411399 and now, at 4pm and 10 seconds it is at N52.523788,E13.4119 and now at 4pm and 20 seconds it is at N52.524183,E13.412437, etc).
  • navigation mode: the method by which the route between the waypoints on a route are calculated; note that even in a manually calculated route navigation mode is still relevant
  • off-road navigation mode: straight lines are drawn between the waypoints on a route on the map; it is assumed this is enough for your purpose (e.g. you might specify enough waypoints so as not to need more than straight lines
  • follow-road navigation mode: the GPS will calculate the route between waypoints using roads; if no roads are available then it will tell you to turn back so that it might approach the next waypoint from another direction
  • GPS navigation software: software for browsing maps, preparing routes, transferring maps, routes, waypoints to and from the GPS
  • MapSource: Garmin’s GPS navigation software
  • Trip & Waypoint Manager: MapSource and one of Garmin’s base maps bundled together on CD and distributed with the GPS
  • Navit, QLandkarte GT, …: open source GPS navigation software

General hints

  • You definitely need more maps! Note that Garmin’s own country maps don’t include cities; city maps are a bundled as a separate product!
  • The maps are expensive! Check out their prices on Amazon or wherever. But you can install maps from the OpenStreetMap project; see below!
  • if you are only using the basic “Trip & Waypoint Manager” map and you are doing on-road routing, then a route from your house to the corner shop will go via the autobahn!
  • Any off-road routing will go “as the crow flies” – in an absolutely straight line.
  • Since on-road and off-road routing can be useful (straight lines are useful for manually calculated routes over fields and small tracks, but obviously not when you’re going from Paris to Prague), it is possible to set the default routing method to ‘prompted’, meaning that whenever you follow a track or a route or go to a waypoint, then you’ll be asked to specify if it should be on-road or off-road. I keep mine on this setting because I use both routing methods about equally.
  • If you want to navigate somewhere and you have no satellite reception you’ll get no instructions because the GPS doesn’t know where you are; if it doesn’t know where you are then it can’t possibly begin to work out how to get to your destination.
  • When looking at the map, a quick press of the joystick creates a waypoint where the cursor is, but a long press of the joystick creates a waypoint where the GPS/you is/are.
  • If you move the cursor on top of a waypoint in order to get it automatically selected and click then you’ll be brought into the waypoint menu (delete, show on map, navigate to). If you choose ‘map’ to show it on the map things look just as they did before, but now if you get the same waypoint automatically selected and click then you’ll be able to move it (correct its position I mean)
  • There are two sorts of compasses: magnetic compasses and GPS compasses; not all models have magnetic compasses. GPS compasses can only tell which way is north when you are moving. This means if you are standing still then north will probably wander around and you should not rely on it.
  • When playing games the cursor is moved by you moving with the GPS, not by moving the joystick
  • Remember to enable track logging before starting a journey. If you do so and then later you don’t want the track you can delete it. If you don’t do so and later you do want the track you’re screwed. This is not applicable to recent models.
  • Routes in MapSource can contain as many points as you like. Routes in the GPS are limited to 250 points (this program will chop stdin into routes with maximum 250 route points, but it has many prerequisites)
  • If you buy a mounting clip to put your GPS on your bicycle, then watch out: there is a package which includes the clip and a replacement back-panel for the GPS, but this back panel does not fit on the GPS models which have a slot for an micro SD card. If in doubt, take your GPS to the shop and and actually try it before you leave! This is not applicable to recent models.

Installing MapSource

This procedure explains how to install MapSource using Wine under Linux rather than explaining how to install it under Windows. To install under Windows simplify the instructions accordingly.

  1. Download MapSource 6.11.6. (This is no longer available on the Garmin website but with some googling you can find it.). The download will be called MapSource_6116.exe. Newer versions seem to have a lot of problems with GPX files.
  2. This download requires that you already have an older version of MapSource installed. If you do not then work around this by running:
    mkdir x
    cd x
    unzip ../MapSource_6116.exe
    msiexec /i MAIN.msi
    cd ..
    rm -fr x

    For the record, newer versions of Garmin BaseCamp have same restriction, but in that case you need to rename the file to whatever.7z and use ‘p7zip -d‘ to unzip it.

  3. Download OpenStreetMap maps (e.g. from here), unpack them (e.g. unzip them in ~/.wine/drive_c/Garmin) and make any necessary registry changes (e.g.:
    cd ~/.wine/drive_c/Garmin
    for FILE in */*.reg; do 
        regedit "$FILE"
    done

    which is to be done when MapSource is not running).

  4. Run:
    winecfg

    and set:

    1. the Windows version to ‘Windows XP’
    2. the drive type to ‘floppy’ (failure to do this will result in the Wine seeing the drive, but MapSource software not seeing it when run on newer versions of Wine!) as illustrated here:
      winecfg-gps-drive
  5. If you want to set up your window manager’s or panel’s menus to run MapSource then I use the command:
    bash -c 'wine ~/.wine/drive_c/Garmin/MapSource; rm -fr ~/My Garmin'

    and I use this icon: mapsource-logo

Pushing maps to the GPS

This procedure covers selecting which maps should go on the GPS, merging those maps into one file, transferring them to the GPS. It does not cover transferring waypoints, routes and tracks.

  1. Power on the GPS, connect it to the computer, and put the GPS in “USB storage” mode.
  2. Make sure the device is now mounted and browsable with your file browser.
  3. Run MapSource.
  4. Select the map tool (either from the ‘Tools’ menu or from the toolbar).
  5. Switch to a product (either from the ‘View’ menu or from the toolbar).
  6. Use the mouse to select from the map tiles that you wish to download to the GPS.
  7. From MapSource’s ‘Transfer’ menu, select ‘Send to device …’; the device should be listed (e.g. as D:); click ‘Send’. (If the device is not listed then rerun winecfg and make sure the device type is set to Floppy disk; this setting isn’t as sticky as it should be.)
  8. Wait. (The merging of maps and the subsequent download are extremely slow).

Pushing and pulling routes, tracks and waypoints

Modern Garmin devices store these data on the internal storage or microSD card, both of which are mountable USB storage devices, so pushing and pulling routes, tracks and waypoints are simple tasks to be done from a file manager.

Post-processing tracks

  1. Pull the GPX track files from the GPS to your PC.
  2. Use Thunar to rename them to YYYMMDD.gpx format.
  3. Download this script, make it executable and run it in the same directory as the track files. It should create mergefile.gpx and simplified.gpx.

Generating Garmin-formatted maps from OpenStreetMap data

You can repeat the procedure for yourself but be warned: it needs a lot of RAM and fast hardware!

  1. If not already installed, install a Java Runtime Environment; how you do this depends on what Linux distribution you use and whose Java you choose to install. It might be as simple as:
    apt-get install openjdk-8-jre
  2. If not already installed, install unzip.
  3. Visit this page and this page at the mkgmap web site, determine the versions of various downloads and save them in environment variables:
    SPLITTER_VERSION=r412
    MKGMAP_VERSION=r3336
    
  4. Visit this page and this page at the bounds and sea web site, determine the versions of various downloads and save them in environment variables:
    BOUNDS_VERSION=20140916
    SEA_VERSION=20140916
  5. Determine the following values for your system and assign them to variables:
    TMP_DIR=<path-with-lots-of-temporary-disk-space>             #  E.g. TMP_DIR=/vol/my-big-disk/osm-to-garmin.tmp
    OUT_DIR=<path-with-lots-of-persistnet-disk-space>            #  E.g. OUT_DIR=$HOME/osm-to-garmin.out
    FAMILY_ID=<pick-a-three-digit-number>                        #  E.g. FAMILY_ID=124
    COUNTRY_NAME=<official-name-of-region>                       #  E.g. COUNTRY_NAME=Europe
    COUNTRY_ABBR=<official-abbreviation-of-region>               #  E.g. COUNTRY_ABBR=EEE  (see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3)
    OVERVIEW_NAME=<lower-case-short-name-no-spaces-allowed>      #  E.g. OVERVIEW_NAME=europe
    URL=<url-of-osm.pbf-file>                                    #  E.g. URL=http://download.geofabrik.de/europe-latest.osm.pbf  (see http://download.geofabrik.de/)
    CORES=<number-of-cores-on-your-computer>                     #  E.g. CORES=64 (see /proc/cpuinfo)
    MBS=<memory-to-allocate-to-this-task-in-MBs>                 #  E.g. MBS=122000 (suitable for a system with 128MB RAM)
    
  6. If you are intending to generate multiple maps or generate maps multiple times then you can preserve your downloads:
    DOWNLOAD_CACHE_DIR=<path-with-lots-of-temporary-disk-space>  #  E.g. DOWNLOAD_CACHE_DIR=/vol/my-big-disk/osm-to-garmin.cache
  7. Download my script for doing the work:
    wget https://svn.pasta.freemyip.com/main/gpstools/trunk/bin/osm-to-garmin
    chmod 755 osm-to-garmin
  8. This script makes the following modifications to the default map style, which are designed to remove clutter on a small screen:
    • hide power lines
    • hide political boundaries (e.g. national borders)

    If you do not want these modifications or you want others instead then modify the script accordingly.

  9. Run the script as follows:
    osm-to-garmin --tmp-dir=$TMP_DIR/$OVERVIEW_NAME --out-dir=$OUT_DIR 
        --download-cache-dir=$DOWNLOAD_CACHE_DIR --family-id=$FAMILY_ID 
        --country-name="$COUNTRY_NAME" --country-abbr=$COUNTRY_ABBR 
        --overview-name=$OVERVIEW_NAME --url=$URL --cores=$CORES --mbs=$MBS 
        --splitter-version=$SPLITTER_VERSION --mkgmap-version=$MKGMAP_VERSION 
        --sea-version=$SEA_VERSION --bounds-version=$BOUNDS_VERSION
  10. When this finishes there should be a ZIP file in $OUT_DIR.
  11. To install the ZIP file, unzip it in C:Program Files\Garmin (or equivalent if running under Wine, using QTLandkarte, etc) and read the README.txt file, which explains how to modify your registry.
  12. Test by running MapSource and verifying that:
    1. there are no registry errors
    2. you can zoom to a very low level without error
    3. Use MapSource to select map regions and download to your GPS
  13. Use MapSource to transfer maps to the GPS (see ‘Pushing maps to the GPS’ above)

Getting POIs

The procedure that was here has been moved to here.

See also