Using GPX for the novice geocacher

From CUOSGwiki
Revision as of 09:59, 24 September 2020 by Loucasdiamantboustea (talk | contribs)
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 users 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


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.

Architecture of 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. The data can be manually converted, or software and web pages will provide the conversions to GPX.

The following is an example of GPX demonstrating the structure and common tags used.

 <?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>

Quantum GIS

For the purpose of this tutorial, the Open Source QGIS (Quantum GIS) software will be used to produce maps and information tables. However, other open source software can be used such as Grass GIS.

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 which 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 which allows for simple navigation through the tools and a very intuitive learning process. It has a full graphical 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 http://www.qgis.org/

GPSBabel

The GPSBabel is an open source program that allows for tracks, waypoints, and routes to be transferred from various types of GPS units. GPSBable has both command-line and graphical interface, which would allow for easier batch processing. The program takes the data and converts it from proprietary formats to the open GPX format. This format allows people with incompatible GPS units to easily share data, and is already popular with the geocaching community for this reason. Since GPX is a widely accepted format, it works with other open source programs such as OpenStreetMap and Google Earth

You can download the application here [http://www.gpsbabel.org/download.html

Goals of the tutorial

  1. Provide an introduction to GPX and its capabilities for novice users
  2. Encourage the free distribution of data for geocaching
  3. Utilize open source software and promote its development and awareness
  4. Uphold OGC standards of metadata and file sharing

Getting Started

  • Ensure GPS unit Map Datum is set to WGS84 when collecting waypoints
  • Coordinates can be off, so expect a geocache to be within 5 meters, on occassion up to 15 meters

Upload your waypoints

Ensure that your GPS unit comes with the connecting cable to hook up to your computer. Entering information manually is extremely time consuming, and easily prone to error. Wrong numbers will result in you wandering around hopelessly searching for the geocache. Connect the unit to your PC and upload the waypoints. There is usually a feature to select all waypoints which will upload all the points at one time into a single file. If you wish to upload only one waypoint, then select this specific point from the menu for upload.

File creation

Select an appropriate location on your computer for saving the file; it will have to be accessed to permit the GPX conversion in future steps. Make sure that your chosen file name is short and concise. You may want to add extensions onto the original name when converting the file in the following steps. This will help prevent any character limitations. Make sure that the format of the file is set to a plain-text ( tab or comma separated) format such as at .txt file. The simple heading format will enable the data to be read correctly and efficiently. Extra information such as symbols and colours can be also added at a later time. You can choose to store your raw data into a spreadsheet, so the fields can be altered at your discretion. Information such as altitude, symbols and descriptions of points can be incorporated.

See the Section 4.4 -Adding extra data to your file before processing to GPX

Converting Your Files

Using a web page utility - GPS Visualizer

There are many web-based utilities freely available online. This particular example will be demonstrated using the GPS Visualizer tool which will convert a GPS file to the GPX format. However, the steps remain consistent as your GPS file must always be uploaded to the web application for processing.

http://www.gpsvisualizer.com/convert_input

Instructions

  1. Select the Browse button at the top of the window; this will open a new window where you can select your GPS file from your computer.
  2. Select the Output format as GPX
  3. Change the drop down menu of Geotag points to select the No option.
  4. Leave all remaining selections as the default and/or blank.
  5. Select the Convert button at the top right of the window.Your file is now processed into a GPX file and a new window will appear.
  6. Right-click on the link and choose 'Save Target As'
  7. Name the file ‘Test’ and make sure to add a .txt extension after the name.
The ‘Save File As’ drop-down menu must show ‘All Files’ for this to happen.

Example of File name : text.txt

You have now successfully converted your GPS file into a GPX format text file which can be openly exchanged.

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