Difference between revisions of "Using GPX for the novice geocacher"

From CUOSGwiki
Jump to navigationJump to search
Line 99: Line 99:
   
 
==QGIS==
 
==QGIS==
Unlike Google Earth, QGIS supports the direct loading of GPX files into the software; however, you must first install the plugin. This is quite simple, and I will walk you through it here.
+
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.
 
* Click the 'Plugins' tab on the menu bar and go to 'Manage and Install Plugins...' menu.
 
[[File:Pluginsbar.png|500px|thumb|center]]
 
[[File:Pluginsbar.png|500px|thumb|center]]
Line 110: Line 111:
 
** 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.
 
** 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.
 
**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 ______). 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 [https://www.gpsvisualizer.com/convert_input?convert_format=gpx 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.
  +
[[File:Gpsvisualizer1.png|500px|thumb|center]]
  +
* 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.
  +
[[File:Pointsfromtable.png|500px|thumb|center]]
  +
  +
===Merging files===
  +
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.
  +
[[File:Mergetool.png|500px|thumb|center]]
  +
* 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.
 
* 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', 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.
+
** 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: [[File:Quickmaplocation.png|100px|thumb|center]]
 
** 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: [[File:Quickmaplocation.png|100px|thumb|center]]
 
** 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.
 
** 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.
 
[[File:Getcontributedpack.png|500px|thumb|center]]
 
[[File:Getcontributedpack.png|500px|thumb|center]]
  +
** 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.
  +
  +
  +
  +
  +
   
   

Revision as of 15:52, 25 September 2020

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 and prepare them for what you wish to do with them
  • How to use various open-source software to transfer these points to and from a GPS device
  • An introduction to making maps in QGIS and Google Earth, mainly for viewing pleasure and to assist in the hunt


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 ________). 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 __________

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 psuedo-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 geochaches 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, but that is not the focus of this tutorial.

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 _______.

Google Earth

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 ______). 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

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.






Using an open source application - GPSBabel

This software provides both the GUI (graphical user interface) and Command-Line interface depending on your preference. For simplicity, the example will use the GUI to translate the files to GPX. Open up the GUI application once the file has been downloaded and unzipped to your computer.

The form is basic, but does offer many choices for input and output file formats. You can convert the comma/tab-separated file that was created above when uploading from the GPS device, OR you can convert the waypoints directly from your connected GPS device.

Instructions

  1. a. Input File from Computer.The input file format needs to be specified, in our example above the selection would be Comma Separated file. This is selected from the top drop-down menu. In the second menu below, select the file’s location on your computer.
    1. b. Input File from GPS device. The user also has the choice of selecting the particular GPS device as the input from the drop-down menu. This would provide a direct conversion to GPX straight from the device. Make sure the radio box is selected to download the waypoints from your device.
  2. Input Options. This allows you to select more specific features when acquiring your file. Details of each feature are explained in the help files.The first option GPS datum can be selected as this is the default datum that should be used.
  3. Output File. The name of the format in the drop-down menue is GPX XML which will convert the input file to a .gpx format.
Specify the location of where you would like the new GPX file saved on your computer.
  1. Select the ‘Let Go’ button to run the application.
A prompt will then appear telling you the conversion is successful.

Using an open source application –QuantumGIS

Using the GPS Tools plugin from the GPS Tools select the Load GPX file tab. This tool is using GBSBabel as a utility within QGIS so the same instructions are applicable when selecting your input and output file details from the previous example.

Creating Maps

The following information provides three differnt options for generating maps with your newly formated data. The first uses QGIS applications as a base to add image layers to your waypoints. The second using a web mapping service from NASA which provides a high resolution global image to demonstrate another method of acquiring layers. The third method demonstrates a conversion into the KML format so the waypoints can be produced onto the Google Earth service.

Using QuantumGIS

Instructions

Step 1 Load Vector Layer

In the new window find the location of your GPX file and open it. This has now loaded the waypoints into QGIS for you to manipulate. The file name appears in the Legend to the left of your screen. The check box within the legend is to toggle displaying the vector layer. The actual points are displayed in the large projection window.

Step 2 Symbols

Expand the vector layer in the legend. This will show what symbol is being used to display the waypoints. Double-click on the vector name and a new window will appear.

Step 3 Layer Property

This window allows the user to change all the element associated with a layer. The first tab is Symbology. Label names can be added and a variety of different point symbols can be selected. The Style Options are how the selected symbol will be displayed in fill and outline colour. Feel free to be creative, as these options can really enhance a map and make important features stand out.
Note: There are many available options within layer properties; trial and error along with the use of the Help files will allow you to master the program.

Step 4 Adding a background

All of the waypoints are displayed and your symbols have been chosen to showcase your geocache location. To print off the map and provide some area distinctions, include a background such as topography or an aerial photo. To acquire such files, the internet is a very useful tool. There are varieties of websites, many from the government, from which you can choose. These images or raster layers have geographical coordinates and can be added quite easily.
  • Weblinks to Goverment map files/images

Step 5 Loading an image

Within QGIS, there is an Add Raster button. This will allow you to add a JPEG, TIFF or GIFF image as a raster layer. These images can be acquired from the list in the Reference section.

Using a Web Mapping Service -OnEarth

OnEarth is a Web Mapping Service (WMS)which is home to a high resolution global image of earth from NASA. This mosaic is known as the WMS Global Mosaic and is composed of more than 8200 satellite images from Landsat7. This will be used to demonstrate an example of how to use a WMS to provide a background image in QGIS.

Instructions

  1. Load the vector data from your GPX file
  2. Select the button Add WMS Layer
  3. Select the New button at the top of the window
  4. Create a name for the service such as ‘OnEarth World Map’
  5. Next, enter the URL http://wms.jpl.nasa.gov/wms.cgi. which sends the request and click OK
  6. Make sure the server ‘OnEarth’ is selected in the drop down menu and click Connect.
  7. A list of layers will be retrieved from the server. Select the first one titled WMS Global Mosaic.
  8. Click the Add button at the bottom right of the screen.
  9. It will take a moment to retrieve the data, but the resulting image is very impressive.

You can now use the Zoom tool to bring your waypoints into a larger scale. Just remember that the data has to be retrieved over the internet, so be patient.

Using Google Earth -KML file format

The KML (Keyhole markup language) is another format based on the XML standard. This file format is mainly used for the display in browsers such as Google Earth and Google Maps. The tag structure is very similar to the GPX format, however they are case sensitive.

Using a web utility to convert a GPX or plain text file will allow for a very simple result. Again, there are a variety available on the web or you can choose to manually convert the file using KML tutorials.

The following is an example of KML to show the structure and basic tags used

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Placemark>
    <name>Simple placemark</name>
    <description>Attached to the ground. Intelligently places itself 
       at the height of the underlying terrain.</description>
    <Point>
      <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
    </Point>
  </Placemark>
</kml>

Download Google Earth http://earth.google.com/


Instructions for GPS Visualizer http://www.gpsvisualizer.com/map_input?form=googleearth

  1. Establish Map Parameters
    1. Set output format to Google Earth
    2. Choose the Uncompressed (.kml) for file format
    3. Create a name for your Google Earth document
  2. Track Options
    1. You may keep all the default settings. A track can be generated if there are several waypoints in the dataset.
    2. The Opactiy can be changed to 0% if no track is desired
  3. Waypoint Options
    1. For the menu Show Waypoints select All
  4. Upload Your Files
    1. Locate the file on your computer to be uploaded and formatted
  5. Create the KML file
  6. You can now click on the link of the file generated and it will automatically open in Google Earth (if it is installed on your machine) OR Right-click and Save Target As to save the file to your computer

Adding extra data to your file before processing to GPX

These additions can be made to the uploaded data files using a spreadsheet program and are performed before the GPX conversion. The files should be opened into the program and the standard headings of Name, Latitude, and Longitude should populate the first row. The extra fields can then be added into new columns and populated for each waypoint.

Description Field Needs to be called ‘desc’ to be recognized. The entry for each point will be displayed next to the waypoint on the map. A description field can be composed of plain text or can consist of a formula which builds upon other field entries. An example of this would be setting the desc field equal to the Name field plus the Altitude field. Thus displaying the full name of the feature and its altitude when mapped.

Add Colour Each waypoint can have its own unique colour. You will need to create a Colour field in your spread sheet. Recognized formats consists of HTML values (black, green, etc.) or the RGB values (#82B3CE, #00F63CD, etc.)

Symbols This feature can only be utilized in such programs as Google Maps and Google Earth, and are not applicable to simple JPEG formats. A symbol heading will need to be added to your spreadsheet. A list of available symbols is available via the web so that the symbol names are matched to the pre-defined symbols. For this example, the symbols square and triangle are widely accepted. These entries would display markers of the chosen colour and symbol you have defined in your spreadsheet.

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). Quantam 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