Working with GPS data in QGIS

GPS devices use a file format called GPX (GPS eXchange File) to record data. Each GPX coming from a Garmin unit is split into:

  • Waypoints - points, describing locations or features.

  • Routes - lines leading to a destination, where waypoints or route points show stage points/turns.

  • Tracks - describe a path, usually formed of a series of track points.

We can use GIS to create, view, and edit data, and export it to a GPS device for use in the field.

Creating New GPX files in QGIS

QGIS allows users to create new GPX files very easily.

  1. Go to "Layer" in the top bar

  2. Select "Create Layer"

    1. Choose "Create new GPX Layer"

  3. Choose a name for your new layer, and where you would like to save it.

Once you have clicked "Save" a set of 3 new files should have appeared in you Layers Panel:

Lets look at one of these files in more detail.

GPX Layer information:

Double-clicking the waypoint layer in the Layers Panel, we can see some more information about the layer:

  • Name

  • Source - where it is saved

  • Storage - what file type it is. In this case, we have made a GPX file

  • Geometry - whether it is a Point, Line/Linestring or Polygon

  • CRS - Coordinate reference system. GPS devices read data in standard WGS1984, or EPSG 4326

Let's look at the Attribute table next:

As you can see, this table is empty - that's because we haven't added any data yet!

As we have created a GPX file, QGIS has made the attribute table fields match what a GPS is looking for:

  • Name

  • Elevation

  • Comment

  • Description

  • Source

  • URL

  • URL_Name

The important fields are "Name" and "Description" - so you can tell which point is which!

Creating new data

Please see the QGIS Tutorial for more information about editing data in QGIS

Let's add some data to our new layers.

Creating Routes

  • Select the Routes layer in the Layers Panel, and toggle the Edit button on and start drawing a line:

  • Once you have drawn your route, right-click to finish the line.

  • A pop-up will appear, allowing you to fill in information about the line - fill in the "name" and "description" sections so you can identify the route on your device!

Creating Waypoints

Let's do the same as the above, but this time lets create Waypoints along the route.

  • Select the layer in the Layer Panel, and toggle Editing on.

We want to ensure that the Waypoints we make are on the route. Let's use Snapping to do this.

  • Toggle the Snapping Toolbar on, and make the Snapping Tolerance "20 px"

If you can't see this tool, check that the Snapping toolbar is enabled. Check that there is a check mark next to the toolbar by accessing it through View, Toolbars.

Once you have snapping and editing on, we can start creating new points along the line.

  • Start by hovering near the line - once you get close enough, a pink box should appear near a line vertex (endpoint or turning point).

  • Click to add the point.

An attribute box should appear, similar to the routes one earlier. Fill this in with information about the point you have just added.

If nothing else, just add the Name and Description information

  • Once you are happy, click "Save" and toggle Editing off.

That's it! you have now made a Route line and a series of Waypoints along it.

Adding data to a GPS

Adding data toa GPS is similar to adding data to any other USB device. After you have connected your GPS to the PC you are using, just click and drag the .gpx file from where you have saved it to the relevant folder in the device.

Garmin devices use "Spanner Mode" to show up on a PC and access the data on it.

Got to System Setup -> Interface, and select "Garmin Spanner."

Then when you connect it to the PC you can choose Mass Storage

Adding Data to QGIS from a GPS

Following the same process above, go to where the file is saved in your Garmin device. The you can drag and drop it into QGIS.

Once you have added the file to QGIS, it looks like this:

This data has been added as READ-ONLY - this is because the data has been locked by the device, and can't be edited.

Editing Data from a GPS

In order to edit data that's come out of a Garmin device, we need to convert it.

Converting GPX Waypoints to Geopackages

We need to convert the Waypoints and Routes to seperate Geopackages so we can edit the copies.

  1. Right-click the layer in the Layer Panel

  2. Select "Export"

  3. Select "Save Features As"

Then fill in the box with the new filename, and click "OK"

We often use "filename_working_date.gpkg" naming convention, so we know which data is in progress, and which is a working file.

You should have a geopackage of your waypoints! Do the same for your routes.

Now, you can edit the files.

Follow the instructions above and there is more information on editing/creating data in the QGIS Tutorial.

If this is an updated version of an older file, it is useful to include "v2" or "proposed_date" in the file name.

This ensures you don't accidentally work off of out of date information!

Converting data from Geopackage to GPX

We need to make sure our new data can be read by a GPS. To do this, we're going to export the data and make sure that the attribute table has the information it needs.

Waypoints:

Format = GPS eXchange Format (GPX) - make sure you are exporting to the right format!

  1. File name = choose where to save the data

  2. CRS = make sure it says EPSG:4326 - WGS 84

  3. GPX_USE_EXTENSION = YES

Routes:

Format = GPS eXchange Format (GPX) - make sure you are exporting to the right format!

  1. File name = choose where to save the data

  2. CRS = make sure it says EPSG:4326 - WGS 84

  3. GPX_USE_EXTENSION = YES

  4. FORCE_GPX_ROUTE = YES

And that's it! Just transfer the files back to your device, and you will have a working GPX file.

Last updated