Using GPX for the novice geocacher

From CUOSGwiki
Jump to navigationJump to search

Background

Geocaching is not only a fun hobby, but it is also a way to connect people from all walks of Earth. Going on a road trip? Why not stop at some interesting locations to hunt for geocaches, where dozens of others have also stopped and left notes or other small gimmicks. Geocaching has come a long way since it first began. The dedicated geocaching app has multiple features that can aide in a user's search, however, most of these are paid services. For instance, the ability to view maps and create lists of geocaches is only available in the 'premium' package. In this tutorial, I will walk you through some simple steps and processes so that you can geocache as well, if not better with the 'basic' package (free) than someone who has paid for the 'premium' package (paid).

This tutorial will cover the following:

  • How to download waypoints from geocache.com
  • How to use various open-source software create simple maps to be used to assist the hunt
  • How to upload your geocaches onto a GPS device, and if necessary, translate them into different formats


GPX

The GPX format is the main tool being used for the collection and exchange of GPS data by geocache users. This is an XML based data format that permits the easy exchange of GPS data between software and web services via the internet.

The formatting allows the data to be accepted by the majority of GPS units on the market without incurring any major compatibility issues. The uploaded data points from event participants will be formatted into the open standard GPX (the GPS exchange format). This will permit smooth data exchange between multiple GPS units regardless of the manufacturer.

The following is an example of GPX demonstrating the structure and common tags used. In the example you can see that this is a geocache located in Lake Garibaldi Park:

 <?xml version="1.0" ?>
<gpx
 version="1.1"
 creator="TrailRepository - http://trail.brijn.nu"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://www.topografix.com/GPX/1/1"
 xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
 <metadata>
  <name>Garibaldi Lake BC Canada</name>
  <desc>Geocache along Garibaldi Lake park.</desc>
  <author><name>John Doe</name></author>
  <link href="http://trail.brijn.nu/"></link>
  <time>2008-10-15T19:43:44Z</time>
 </metadata>
 <wpt lat="49.957361" lon="-123.119944">
  <ele>0</ele>
  <name>T.Head</name>
 </wpt><rtept lat="49.947633333" lon="-123.083983333">
  <ele>0</ele>
  <name>T01P29</name>
  </wpt>
</gpx>

GPX schema was initially released in 2002, and it became the GPS standard in August 2004. These files contain a description of what’s inside so they can be understood by various programs and users. Most GPS units will automatically generate their points in GPX format but on the odd case that they don't, there are a couple of ways to change the format into or out of GPX.


Converting different formats

GPSBabel

GPSBabel is an open-source program that allows for tracks, waypoints, and routes to be transferred from various types of GPS units and file formats. GPSBable has both command-line and graphical interface, which would allow for easier batch processing. The main draw of this program is that it can convert between multiple format types, and can both download and upload points to/from most GPS units. GPSBabel uses the GNU Public License, and as such, the program can be altered by any user to their liking. This allows other open-source programs like QGIS to have GPSBabel integrated into their system as a plugin.

You can download the application here

You can view a more comprehensive list of compatible Garmin units here

GPSVisualizer

GPSVisualizer is a website dedicated to converting between GPX files, plain text/CSV, and KML files (for Google Earth, we will talk about this in a later section #Mapping in Google Earth). It also offers other features, such as plotting points, but we will not be using that in this tutorial.

To access the tool we will be using, go here

Although we are not using the other tools, I encourage you to look around and explore the options presented.


Mapping

Quantum GIS

For the purpose of this tutorial, the open-source QGIS software will be used to produce maps. We will also explore using Google Earth in a later section Mapping in Google Earth

QGIS was started in May 2002 and made available for download through peer sharing networks. Many versions have been developed since the initial program. Now QGIS is a fully functioning Geographic Information System that runs on all main platforms such as Linux, Mac, Windows and Unix. The program supports a variety of data including, vector, rasters and database formats. QGIS is licensed under the GNU Public Licence (MicroResources, 2008).

QGIS is a reliable GIS program that allows for simple navigation through the tools and a very intuitive learning process. It has a full graphical user interface so users regardless of experience level can utilize the software. Hardware requirements are minimal for QGIS, so the vast majority of desktops will be able to operate the program on Windows, Mac and Linux operating systems.

QGIS available for download here

QGIS Plugins

As with GPSBabel, the public license allows users to alter the program and add whatever they like to their own version, because of this, QGIS has a suite of downloadable plugins that offer features and services that are not in the base version of QGIS. GPSTools is one of these plugins, and it is the one we will be using in this tutorial. GPSTools operates by using GPSBabel to download or upload points between GPS units. The only drawback to this is that it only seems to be operating with GPX files.

Google Earth

The other mapping program we will be exploring in this tutorial is Google Earth. Google Earth can act as a pseudo-GIS in terms of mapping capabilities. There is enough to make a fairly basic map, but it will be nowhere near the detail as those that can be made in QGIS.

Google Earth uses KML files to operate, and if you recall this is one of the types of files that are converted with GPSVisualizer. This conversion is necessary, as Google Earth only works with KML and does not have support for GPX files.

I will be covering the web version of Google Earth, but all of this can be done on the desktop version as well. To access Google Earth, click here

Downloading data

The first thing that you must do is download the points you want from geocaching.com or any other geocaching websites that you come across. Then they will be converted into whichever format that you would like.

Once you have the geocaching loaded, use the search bar to search for geocaches near the location you are going. You will be faced with a screen like the one below, choose the geocache(s) that you wish to download. In this case, I will download 'double double' for example purposes, but feel free to choose multiple in an area. In fact, I recommend doing that because it will make the maps we create so much better.

Example of what it will look like after searching for geocaches

When you choose a geocache, download the GPX file. This can be repeated for all the geocaches you wish to find, but I would make sure to download them all to a chosen folder, this will make the next steps much easier. Unfortunately, I do not know of any other way to make this less tedious.

How to download the geocache GPX file


NOTE: If you would like, there are some websites that can merge GPX files into one, or you can do it by altering the GPX through the text editor. We will also cover how to merge them once in QGIS.

Map making

You should now have all your GPX files downloaded and in one folder. The next step is to load the points into QGIS or Google Earth to make a map. If you wish to skip this step and immediately load the points onto the GPS, go to section #Upload points to GPS.

Mapping in Google Earth

Google Earth offers a simple way to overlay point locations onto their satellite imagery. The maps that you can create through this software aren't necessarily going to be as in-depth and detailed as QGIS, but they are simple and do the trick in much less time than with QGIS. One perk of this software is that there is substantially less to figure out and troubleshoot.

Converting to KML

Unfortunately, Google Earth only supports the loading of KML files, rather than the GPX files you just downloaded. This is an easy fix though, through the use of GPSVisualizer it is a quick translation.

  • Head to GPSVisualizer.
  • I would recommend changing the 'Output file type' from '.kmz (zipped)' to '.kml (uncompressed)'.
  • Add your GPX files containing the geocache data, you can load in up to 10.
  • Click 'Create KML file' and download your new data.
Gpsviskml.png

Importing KML into Google Earth

You now have all your geocache locations saved as KML files, here's how to get it into Google Earth:

  • Open Google Earth. Remember that I will only be discussing the web version.
  • On the left side of the screen, select the 'Projects' menu. It'll look like a placemark, there will be an image showing its location if you are having trouble.
  • If you have not already created a project, click 'Open' and choose 'Import KML file from computer'.
  • If you do already have projects created, create a new project and choose 'Import KML file from computer'.
  • Choose the KML files you just created and let it load in.
GEloadKML.png

Finalizing the map

Now that your geocaches are in Google Earth, we can begin to make the map look a bit better. Google Earth is not as customizable as QGIS but you can still change symbology and alter the satellite imagery slightly.

  • In your project, open up the waypoints menu.
WaypointsGE.png
  • Hover over the geocache's you wish to change the symbology, and choose 'Edit feature'.
  • From here you can change things like font, and icon.

NOTE: On the far left panel, below the 'Projects' tab, there is a tab titled 'Map style'. You can use this to alter what is shown on the satellite imagery. You can turn things on and off like roads and other overlayed data.

At this point, there is not much else you can do. Take a screenshot of your location with all your geocache locations. If you are using the desktop application you can do a bit more in turns of generating a legend and an actual map, but unfortunately, that is not yet a feature in the web version.

QGIS

Unlike Google Earth, QGIS supports the direct loading of GPX files into the software; however, you must first install the plugin 'GPSTools'. This is quite simple, and I will walk you through it here. This process can also be done by converting the GPX files into a CSV with GPSVisualizer, and loading it into QGIS like that, I will walk you though that after.

Loading in with GPSTools

  • Click the 'Plugins' tab on the menu bar and go to 'Manage and Install Plugins...' menu.
Pluginsbar.png
  • Search for GPSTools. The plugin will already be enabled, you just have to click on the checkmark.
Note the checkmark next to the name
  • Now load up the GPSTools plugin by selecting it from the 'Vector' tab on the menu bar. It should be next to the 'Plugins' tab.
  • You will be met with the GPSTools interface, for now, we will just be dealing with the 'Load GPX File' tab, but feel free to look into the other tabs. Repeat this step as many times as needed to load all your files.
    • We will discuss the 'Download' and 'Upload' tabs in a later section. Note that there seems to be an issue with the 'Import Other File' tab, I have tried it with multiple different files (that aren't GPX) and QGIS had crashed, it could just be my machine.
    • Also, note the final tab 'GPX Conversion', this tab allows waypoints, tracks, and routes to be simultaneously converted between each other. This only works with GPX files.
  • You will likely have multiple layers now, don't worry, we will merge all the layers into one soon (section #Merging file once in QGIS). This will also make it so in the end, you will only have one GPX file being transferred into your GPS.

Loading in using a CSV

  • Head to GPSVisualizer and choose the files you wish to convert. Keep in mind that you can only upload 10 at a time.
  • Ensure that you have selected the 'Output format' as 'Plain text' and that you have changed the 'Plain text delimiter' from 'tab' to 'comma'. This will make it so that the data is converted into a CSV instead of a text file. Don't worry if you miss this step, text files can be opened in most spreadsheet software with a small hassle.
Gpsvisualizer1.png
  • If you wish to edit the spreadsheets, go ahead. Here you can merge them into one, add better descriptions, or whatever you like. Just make sure that you don't alter the column titles, as they are required for one way of returning the file to a GPX.
  • Now in QGIS, click the 'Processing' tab and check on 'Toolbox'. There will be a panel on the right that pops out and contains all the tools present in QGIS.
  • In the search bar, search 'Create points layer from table' and select the tool.
    • Click the '...' for the input layer to search for the table of geocaches.
    • For the X and Y field, choose longitude and latitude respectively. These are values directly from your input table, so if they aren't options you may have added the wrong table.
    • Set the CRS as WGS 84 (This will likely already be chosen)
    • Save the file to your folder by choosing the '...'. I would recommend saving it as a .shp; however, it is possible to save it as a GPX here, but I have found that to be extremely unreliable and hasn't worked very well for me.
Pointsfromtable.png

Merging files once in QGIS

If you have a bunch of different layers representing your geocaches, I would recommend merging them into one file. This will make symbolizing them much easier and faster, and also make it so that transferring them back into GPX and onto the GPS is fast and efficient. This can be done easily using the 'Merge vector layers' tool from the toolbox.

  • Like creating points from a table we did in the last step, search the toolbox for 'Merge vector layers'.
  • Click the '...' and choose all the layers you wish to merge. These will be all the GPX layers that you loaded in previously.
    • If when you press 'OK' the tool disappears, don't worry, it didn't crash, it was just moved to behind your QGIS window. This happens to me on a Mac so look around a bit, it's there somewhere.
  • Set the CRS as WGS 84 and save it to your folder. Again, I would suggest saving it as a .shp.
Mergetool.png
  • You should now have a new layer that is all the geocache locations in one. If you would like, you could remove all the other layers, or simply turn them off by clicking the checkmark next to their name. This just relieves clutter.

Adding a basemap

  • All of your points will now be displayed in QGIS. You should now add a satellite basemap so that you can gauge the surroundings of the geocache locations.
    • To do this, install the plugin 'QuickMapServices' (QMS), much like you did with the 'GPSTools' plugin; however, this plugin is not already installed, so you have to go through that process first. Don't worry, it only takes a couple of seconds.
    • The tool will now be available in your toolbar along the top. You may need to play around with some of the options to get it to show, but it will appear as a globe:
      Quickmaplocation.png
    • I would suggest adding more basemaps to the tool by going to QMS settings > More services > Get contributed pack. This step is not necessary, but it adds a much wider selection of basemaps, including much of the ESRI and the Google library.
Getcontributedpack.png
    • You can now choose from any of the basemaps available through QMS, for the purpose of this tutorial I would suggest the ESRI or Google satellite imagery. I have found that the ESRI imagery runs better.
  • From the 'layers' panel on the left, ensure that the basemap is below your GPX files.

Finalizing the map

With all the points and the basemap added, you should have everything you need to create a helpful. In this tutorial, I will show you how to make some quick and easy changes to your map, as well as a simple introduction into how to export the map so that you can print it.

Symbology

It may be difficult to see some of your geocaches, especially if they are present in a wooded area. Here, I will walk you through how to change the symbology so that they will pop a bit more.

  • Right-click on the layer containing the geocache points. This will be in the left panel.
  • Select 'Properties' at the bottom of the list.
  • Once in the properties window, there will be a bunch of options and menus that you can sort through. For now, click on the 'Symbology' menu in the left panel.
  • From here it is all about how you wish to set your symbology. There are a few things to note:
    • Choose a colour that is in contrast to the surroundings. Red is often a good starter, but it is not always necessary as it can be a bit too harsh sometimes.
    • You can alter the actual symbol itself, there is a decent library off symbols already in QGIS and you shouldn't have an issue for this map. If you are looking for other symbols, they can be loaded in as an SVG file. I won't go into more detail, but check out this site or this one if you are interested in learning more.

Labels

Labelling is always useful, it will help you determine what's what, and makes life easier when looking at a map.

  • Like symbology, head to the properties menu, this time select 'Labels' from the left panel.
  • There likely won't be anything in the menu except a single drop-down menu. Click the menu and select 'Single labels'.
    • This will make it so that the labels apply to all points based on the same criteria. You can alter criteria depending on 'rules' by choosing the 'Rule-based labelling' option.
  • All the fields will automatically fill, so if you don't want to you don't have to change anything, your points will be labelled. However, here are a few tips:
    • Make sure the value is set to 'name', or whatever you want the label to say.
    • You can increase the font size if you'd like, it usually starts small.
    • I would recommend turning on a buffer. This will add white to behind the label, making it easier to read. I find this often corrects for having a small font size, so check to make sure it isn't too big and covering up too much of the map.
    • You can change the placement if you'd like.
SymbologyQGIS.png

Print layout

Now it's time for the most frustrating part of any map making, getting the map to actually look nice. If you'd like to skip the step of adding a legend, scale bar, and north arrow, you can just screenshot the part of the map that you want. At this point, the labels and symbology are what they will be on the final map, so this last step isn't necessarily needed. I will have a picture at the bottom of this section with the important tools highlighted, so don't worry if the steps are confusing.

  • Along the toolbar, next to the save icon there is a tool that's called 'New Print Layout'. Choose this and give it a name.
  • You will be welcomed by a completely new window. Note the tools along the left side of the window. These are how you will add the map frame, legend, scale bar, and north arrow.
QGISmap.png
  • The first squared tool adds a map frame. You can add this however you'd like, it will automatically add the map that you created with your geocache locations.
  • The legend, scale bar, and north arrow can now all be added. They will automatically be related to the map frame you added.
    • You may add these wherever you'd like, but it's easiest if you leave some white space on the layout.
  • If you're legend is full of layers that aren't being shown on the map, go to the legend properties.
    • This can be done by right-clicking on the legend, or in the items panel on the right, choosing the legend and navigating to 'Item properties'.
  • From the legend properties, scroll down and check 'Only show items inside of linked map'. This will remove all the excess layers.

Now that your map is completed, you may use the tools along the top toolbar to either print, export as image, or export as PDF.


Uploading points to GPS

By this point in the tutorial, you should have:

  • A map with all your geocache locations (unless you skipped ahead)
  • GPX file(s) with all you geocache locations
    • If you skipped ahead, or used Google Earth instead of QGIS, you may have multiple GPX files.

From here, you now just have to get that file(s) onto your GPS unit.

If you used Google Earth, you should already have GPX files. Skip to section #Uploading to GPS.

If you do not have a unit that works with GPX, ensure that you have a GPX file then skip to section #Uploading to GPS.

First, plug your GPS into your computer.

NOTE: Make sure that you are using the correct connecting cord. My computer did not recognize my unit until I switched to a Garmin cord, I am not sure if this is a common issue (I would assume it isn't, I haven't been able to find much on it) or if the cords I was using before were damaged in some way.

Straight from QGIS

If you are already in QGIS with your one file containing all your geocache locations, this should be quite simple.

NOTE: QGIS only works with uploading GPX files, so your unit operates with a format other than GPX you may want to skip forward; however, if you have an SHP in with all your locations in QGIS, see the following step to convert it into a GPX, which can then be converted using GPSBabel.

If saved as SHP

If your file is saved as an SHP like I said you should do, there is a quick export that you must do first.

  • Right-click on the layer with all your geocache points.
  • Select 'Export' > 'Save Feature As...', and choose to save it as a GPX.
    • Note that you will likely have to check the option 'GPX_USE_EXTENSIONS' to on.

If saved as GPX

If you saved the file as a GPX before, or just finished the previous step, we will be using the GPSTool to upload the GPX to the GPS. By the end of this section, you will have the points on your GPS.

  • Load GPSTools.
  • Go to the 'Upload to GPS' tab.
  • Choose the GPX file that you created, and choose the correct device and port.
    • Note that the only device that is pre-coded is the 'Garmin Serial', you can add new devices by choosing the edit devices and coding it in. Check out this website for help doing this.

Using GPSBabel

Converting to different formats

  • Ensure that your 'input' and 'output' are checked as 'file'.
  • Load your GPX file.
  • Choose the format you'd like to translate to and save the file.
BabelFiletoFile.png

Uploading to GPS

  • Ensure that you 'input' and 'output' are checked as 'file' and 'device' respectively.
  • Load your file that you wish to be uploaded. This will be in GPX or another format that you just translated to.
  • Choose the correct format (Garmin serial/USB protocol is likely to be good). If you need help with this, check the 'Help', it will take you to the documentation.
  • Choose the correct output device (Your GPS).
BabelFiletoDevice.png




References

Foster, D (2008). GPX for developers. Retrieved October 23, 2008, from The GPS exchange format Web site: http://www.topografix.com/gpx_for_developers.asp

MicroResources, (2008, July). Quantum GIS. Retrieved October 18, 2008, from QGIS.org Web site: http://qgis.org/index.php?option=com_content&task=blogsection&id=1&Itemid=99

Helpful Web Links


Sites for georeferenced images