/LifePath

Everywhere you've been, traced out by a single continuous line across the planet. Built in 24 hours for HackCambridge 2019

Primary LanguagePython

LifePath

How to run it

  1. Follow these instructions from Google to "checkout" your full location history as KML.

  2. Clone this repo and then run LifePath.py with any of these 4 flags:

Flag Purpose Example Usage
-shorten To prepare a shorter list of location data ./LifePath.py -shorten locations.kml
-plotall To generate a single image with one LifePath ./LifePath.py -plotall locationsSHORT.dat
-plot To generate a set of images for GIF-making ./LifePath.py -plot locationsSHORT.dat
-gif To generate a GIF from the set of images ./LifePath.py -gif images/*png
  1. The plotting scripts can work on any list of (lat,lon) pairs, i.e. a file that looks like this:
(-1.5133032, 48.6360166)
(0.00654029, 51.3152748)
(-3.2694487, 51.5022199)
(0.00744029, 51.7752748)
  1. The source code of LifePath.py can be tweaked to change the colour, aspect ratio, resolution, etc.

Description from the Devpost submission

Inspiration

I realised I've carried a smartphone since 2011 so my location history was pretty reliably captured since then. You can download this from Google but it's just a block of coordinates in KML, so I wanted a visualisation. I thought a single unbroken line would be an elegant way to see where I'd been, like a wake or trail of footprints.

What it does

  1. Shorten the list of locations: Google allows you to "checkout" your full location history as KML. For me, this resulted in over 450,000 pairs of latitudes and longitudes. Most of these were very close together (e.g. home, office, supermarket, repeated ad nauseum). Running LifePath with the -shorten flag will tidy up the huge KML file that Google gives you and reduce it to locations separated by at least 100km. For me, that stripped it down to just over 200 locations.

  2. Plot geodesics between all those points: a geodesic is the path of minimum distance across a curved surface (hence on flat map projections, flight paths appear curved). Using the -plotall flag will produce a single map with a single LifePath for all the input data. City name labels are optional. Using the -plot flag will produce a folder of images with each additional geodesic (which can then be combined into a GIF). This is what the combined LifePath looks like (higher quality version on Imgur): Alt Text

  3. Animate the LifePath in a GIF: all the geodesic maps created using the -plot flag can be combined into a GIF using the -gif flag. The result looks like this (higher quality version on Imgur): Devpost-compressed GIF