Sailing Tracklog Map in QGIS - www.cdedwards.com

Sailing Tracklog Map in QGIS

Sailing Tracklog Map

This is a map of our sailboat tracks from the 2018 and 2019 field seasons on the Central Coast of British Columbia. At that point in time, we'd done about 4000 nautical miles on our first sailboat Great Blue Heron.

Purpose

The map was made for a conference presentation and was meant to help people visualize what two seasons of sailing science looked like in the Great Bear Rainforest. But I found that I started looking more at the places we hadn’t been yet, so for me it ended up as a way to find gaps that we might want to explore.

Step 1: Getting the files into QGIS

The plotter on our first boat was made by Humminbird. You can export all your tracks, routes, and points from the unit, but it wraps them in a proprietary file format called an “.HT” file. To get around the stupid proprietary file formatting I ran the tracks through a slick little bare-bones conversion program called ‘GPS Babel’. 

GPS Babel does what the name implies: the program can speak to all the proprietary GPS file formats and convert them to whatever you need, including geopackages and shapefiles. I have not been super successful with their geopackage conversion, but you can always choose something more mainstream like a GPX (universal GPS format) or KML (Keyhole Markup Language aka Google Earth format). I like the program because it is something you download and run off your desktop so it works out of reception.

Once converted, the files load directly into QGIS through the ‘add vector layer’ window or drag-and-drop into the layers panel. On our plotter tracklogs were made by logging a lat/lon coordinates every 5 seconds. We logged at a high resolution because we used sections of the tracks for science, but most people will be fine with logging a point every 5 or 10 minutes. After 4000 nautical miles at 5 seconds we had a lot of points. The density of the data resulted in a devastatingly slow render in QGIS because it had so many vertices. But there are a few ways to get around the long load times.

One option is to simplify the data and remove some of the vertices, but I didn’t want to lose the resolution of the data because we sometimes extract sections of it if our field work GPS had a problem. So I find it helpful to do some processing on the raw files to clean them up, and then merge them into a new file to do the map display. This way, the original resolution isn't lost.

To get through the first step it helps to tell the map window to stop rendering, or you can do all your draft styling and attribute table editing with the layers not displayed.

I merged all the track layers into a single layer. This tool generates a new data layer and leaves the originals untouched in case I ever want to go back to them. Once merged, I went through and deleted extra junk from the attribute table (useless fields generated by the GPS export) and created a category to classify the lines by time (year/mm/dd).

With everything merged and the attribute table cleaned it was time to simplify the data so it renders in a reasonable amount of time. There are a few ways to simplify geometries in QGIS. I chose the SAGA tool “line simplification.” It’s a basic tool with only one parameter to set which is the tolerance (in map units). Depending on your projection the units will be either meters or degrees. I went with 10 meters (my CRS is Nad83/BC Albers ESPG 3005). The tool specs explain ‘Tolerance’ as the “maximum deviation allowed between original and simplified curve.” The tool uses the tolerance you set and does it’s best to simplify a shape while preserving its appearance.

Step 2: Styling

Once the tracklogs were merged into a single file and simplified they loaded much more quickly. Now I could start playing with the basemap and styling. I chose the ‘Bing Virtual Earth’ imagery as my basemap and added it in through the WMS service using the T+ plugin. Bing often has better  imagery than Google, especially on the water.

For styling the lines I set them to display with the 2018 tracks on the bottom and the 2019 tracks on the top using the manual symbol levels. Then I experimented with some bright colour ramps that would show up clearly over top of the dark basemap imagery. I settled on a ramp that went from purple to orange, with the orange colours for the 2019 tracks. It’s not a distinct enough set of categories to really pick out the years, but it adds a bit of variety into the colours of the lines that I think makes it look more interesting.

The original map didn’t have any place labels because it was being used for an audience that was very familiar with the region. But I figured that might not be the case with this blog so I spent some time building a custom label layer. I fit the labels to compound curves and used the attribute table to define the styling of the labels (font size, bold, italics, buffer, buffer rendering).

Step 3: Export

Once I was happy with the labels I exported it as a 300 dpi PNG. I like to give a map a few days to simmer and I go back to it the next day to look for any edits that I want to make.

Back to blog