Monday, 4 November 2013

Homemade gps plot of London

One of the limitations of www.gpsvisualizer.com is that it has an upper limit on the filesize of the raw GPS traces of 3mb. The log of treks across London reached this data limit at the start of last week, and whilst there were some measures I could take to reduce the size, it was unsatisfying and a better solution was required.

Using my bare ninja skillz I wrote a script in perl that processed the raw gps data from a txt file and then generated a png image file from scratch.

perl script
Larger version of map
AllTraces file

Writing the script myself allowed me to more finely control what was being plotted. One of the first things I added to the plot was a grid. This was simply done by creating a txt file with the coordinates and then drawing them as lines rather than points.
grid file

As well as gps traces of my walking routes across London I'm also tracking routes that I travelled on public transport and by car. These are plotted in red.
vehicle log file

One of the problems I've encountered and not satisfactorily addressed is that the gps coordinates are latitude and longitude, which because the world isn't flat, don't have a consistent aspect ratio. As you go further north from the equator the latitude ought to get closer together. This is why the grid squares are rectangular. If I lived in sunnier climes they would be more square.

As I'm mostly wandering round one city on the surface of the earth I can approximate a fixed aspect ratio. Although I could really do with getting my head round a better formula, something to do with the radians and the cosines.

No comments:

Post a Comment