qgis – ant.burnett.com.au https://ant.burnett.com.au Thu, 19 Nov 2020 04:54:17 +0000 en-AU hourly 1 https://wordpress.org/?v=6.9.1 https://ant.burnett.com.au/wp-content/uploads/ant-outline-200.png qgis – ant.burnett.com.au https://ant.burnett.com.au 32 32 How to overlay a GPS route on an orienteering map https://ant.burnett.com.au/overlay-gps-on-orienteering-map/ Thu, 19 Nov 2020 02:10:35 +0000 https://ant.burnett.com.au/?p=342 Have you ever wanted to overlay your GPS route on top of an orienteering map? This article explains how it can be done.

A full-sized image is not a great way of interacting with an orienteering map. PDFs are OK – you can zoom and move about pretty well. But what if you want to overlay your GPS route on top of the orienteering map?

Demo

Here’s an orienteering event in Sydney from November 2020 that uses the techniques from this article.

Tools Required

This can all be done for free.

  • An orienteering map in either PDF or raster format. https://www.omaps.net/au is a great source to experiment.
  • QGIS
  • A static web server such as Netlify or any number of other solutions. There are free tiers available.

Prepare the Map

If you have a digital image of an orienteering map, chances are that it is not geographically enabled. It is just a series of pixels of different colours that went put together form a map. It is not connected to the real world, and we need it to be! This process is called georeferencing.

Import the GPX

TODO: importing GPX into QGIS

Set QGIS styles

TODO: setting some basic colurs in QGIS for the GPS track.

Export the tiles

TODO: THe processing toolbox is your friend.

Edit the HTML

TODO: Customise the default generated HTML and location of tiles.

Publish the HTML

TODO: Put the HTML and tiles where people can see them

 

]]>
Orienteering Summer Series #7 – Telopea https://ant.burnett.com.au/ss7-telopea/ Wed, 18 Nov 2020 07:01:44 +0000 https://ant.burnett.com.au/?p=341 This week saw the Sydney Summer Series orienteering venture to Western and Hills OrienteersVineyard Creek map in Telopea.

The prelude to the event suggested fun was in store:

THIS SUBLIME AND PEACEFUL POSER ALWAYS ATTRACTS.
From a scatter across the upper ‘home’ reaches, runners descend to the wonders of Vineyard Creek and beautiful creekside bush track running. As the controls draw you on and on, down and down, the clock ticks. One of Sydney’s hidden orienteering gems.

Race Review

This week I thought I’d play with a new way of presenting the final run using map tiles generated by QGIS. Here’s the final result – it took about 5 minutes to create the tiles and publish to my webserver.

Source: https://omaps.burnett.com.au/vineyard-creek/

I started off pretty fast in the footsteps of Bennelong runner Brian Brown. Brian was running fast, but making little mistakes in and around control circles allowing me to catch up. He said on Strava he had his best result yet, so I hope I helped him with that.

Sore Achilles and lack of fitness made the last two kilometres very difficult. They were mostly uphill and the time limit was coming up very quickly.

The segment from control number 2 to the finish was my fastest pace as I watched my watch tick closer to the minute 48. 47:40, 47:50 seconds, and still not there. I dabbed my SportIdent in and the record shows 48:01 – damn. 2 seconds over the minute earned me 10 penalty points on top of the other 20 points already deducted.

I finished with 500 points – two seconds faster and I would have moved from 28th to 24th. Top 20 by the end of the season?

Navigation Errors

Not too many this week!

It had been my intention to go from #9 to #16 if I was to make it back in time. Next thing I knew I’m standing next to a pipeline near #25 realising I was meant to go to #16.

Oh well, I’m at #25 now so better keep going. I lost 1 minute on the edge of the circle of #25 with a pipeline that also looked like a bridge. Decisions were made to go to #12 and grab those 20 points and hope the extra time was not wasted.

Result

According to https://sydneysummerseries.com.au/season/202021/event/7/results/order I earned a place of 28 out of 200. My best score (500) of the season so far, but still off the pace of Richard, Glenn and the young guns.

Strava

]]>
Exporting QGIS to PostGIS in 3 steps https://ant.burnett.com.au/exporting-qgis-to-postgis-in-3-steps/ Mon, 26 Oct 2020 06:38:39 +0000 http://admin.burnett.com.au/?p=141 So you have a layer in QGIS that you want to export to PostgreSQL/PostGIS as a new database?

Create a new Database in Postgres

  • In your preferred database GUI (I use Dbeaver Community Edition), create the database.
  • Add the PostGIS extension! Execute the following:

CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;

Create the Postgres Connection in QGIS

Here are the steps:

  • In QGIS, locate the Browser panel
  • Right-click on PostGIS and select New Connection…
  • Complete the values for
    • Name e.g. fnweb31_omaps
    • Host e.g. 192.168.1.31
    • Database as created above e.g. omaps
    • (Optionally, turn on Allow saving/loading QGIS projects in the database)
  • Click Test Connection to verify it works
  • Enter credentials for Postgres
  • A message appears at the top of the dialog detailing whether the connection worked or not.
  • Click OK

There is a new connection on the expanded PostGIS branch of the Browser panel. Let’s keep going.

Open the DB Manager

  • Go to menu Database > DB Manager
  • Expand the PostGIS branch
  • Select the newly created fnweb31_omaps connection
  • Click the Import Layer/File… button in the ribbon
  • Change the Input dropdown to the layer you wish to import. The list of currently opened layers is pre-filled, or you can browse to another file.
  • Set the Schema to public unless you have other reasons for changing it
  • Set the table name to the desired name – it is prefilled with the existing name in QGIS or you can change it
  • Click OK
  • Re-enter credentials if required
  • Close the DB Manager dialog

Now we have a geographic layer stored in Postgres that can be queried, edited from anywhere and by any number of people. It’s fast, robust, and how things should be.

]]>