Skip to content

Importing GPS tracks

April 23, 2008

One of Potlatch’s least-known, but most powerful, features is the ability to directly import a GPS track.

Everyone knows that you can click the little eTrex-like GPS icon in the bottom left and show GPS points for the current area. But what if you want to import a whole day’s tracklog at once?

Upload your track as usual. Then, on the ‘GPS Traces’ tab on the site, click the ‘edit’ link to the right of your track – not the one at the top of the screen. Potlatch will open, and after a few seconds, your track will appear in the usual light blue… and you can trace over it as usual.

Extra features

That’s the summary. Here are the fun bits.

First of all, this way, you don’t have to wait for the track to be imported into the database – you can work with it as soon as it’s uploaded. This is hugely useful on Sunday evenings when everyone is uploading their weekend’s mapping and the upload queue stretches to the next continent and back.

Secondly, the waypoints are brought in, too. So you can use your GPS to mark up things you saw while mapping – a gate across a road, perhaps, or the point where a road becomes a track – and get these notes directly into Potlatch. Waypoints are imported as POIs (points of interest), but are “locked”, so they don’t get automatically uploaded to the database. (If you do want to upload them, then just tag them up properly, then click the little padlock by the POI number, and deselect as per usual.)

Automatic conversion

The really, really good bit is that you can automatically convert your tracks to ways. This is no use when you’ve been mapping a housing estate, of course, because you’ll have doubled back on yourself at every cul-de-sac, gone up and down the same road several times, and so on. So you should still trace manually then.

But if you’ve driven along a winding 50-mile rural road, this feature can save you an awful lot of tracing.

To take advantage of this, wait until the GPS track has loaded (light blue line), and then click the ‘Track’ button at the bottom of the page. After a few seconds, a new, bright red way will appear.

Like the waypoints, this way is “locked”, so it’s not uploaded to the database. What you should do is split it, join it to existing ways, and tag it properly – basically, make it a proper part of the map. Then, when you’ve finished, click the little padlock by the way number. The way will turn from red to its proper colour. As usual, deselect to upload.

Converting GPX tracks directly to ways can have a pitfall: if you’ve recorded a trackpoint every second, that’s a lot of unnecessary points on long, straight journeys. So Potlatch does a couple of things to avoid this. When you click ‘Track’, it “simplifies” the track to remove all the unnecessary points on straight lines. (For the curious, this is done using the Douglas-Peucker algorithm.) And it won’t let you unlock a way if there’s more than 200 points, so you should split it into smaller ways first.

Advanced features

As part of Potlatch 0.8b, I’ve added a couple of power-user refinements to the GPS track import. Most users won’t need them, but if you find yourself using this feature a lot, you may appreciate them.

If you find the tracklog-to-way simplification too coarse, and think it makes curves too jagged, you can now hold Shift when clicking ‘Track’. This will run a finer simplification over the track.

(Should Flash ever give you a warning like “A script is causing Flash Player to run slowly”, just continue – don’t abort it. Processing a 20,000-point track can be fairly intensive work. :) )

You can now also edit the query string (the part of the URL after the ‘?’). Usually you’d just have something like ‘?gpx=97019’ – i.e. edit track 97019. But you might want to start editing at a particular latitude and longitude, so you can supply those too: ‘?gpx=97019&lat=51.5&lon=-2.1’. You can also load more than one track at once, by separating the numbers with commas: ‘?gpx=97019,97021&lat=51.5&lon=-2.1’. This is useful if your waypoints are all in one file and your tracklogs in another.

From → tips

Leave a Comment

Leave a comment