I’ve been doing some work this week on “geopresence archiving,” culminating in the release of some code, called GeoArchive, that will slurp in Foursquare, Plazes, Twitter, Openpaths, Google and Flickr geopresence data and convert it into GeoJSON.
GeoJSON is a funny thing: you’d think that the last thing the world would need is yet another format for GIS data. But it turns out that is exactly what the world needed, for GeoJSON appears to have hit a sweet spot of portability, understandability and flexibility that is causing a whole new set of geographical tools to flower.
Using the aforementioned GeoArchive, I converted every single geopresence I’d logged in the last 10 years (starting in 2004 with Plazes and continuing until the present) and dropped the resulting GeoJSON files into a GitHub repository called geotraces (yes, that’s making public some detailed private information, but it’s information about the past, and I haven’t murdered anyone or had an affair, so I’m comfortable with that).
I then used the (excellent, free, open) GitSpatial tool to sync that repository so that I could use its spatial querying magic to extract interesting insights from it.
I eat lunch at Tai Chi Gardens, a small vegetarian restaurant around the corner from my office, several times a week.
But exactly how often do I go there?
I decided to use my newfound geo-superpowers to find out.
I used the (dreamy) BoundingBox tool to get the coordinates for a bounding box around the restaurant, building in a comfortable buffer to allow for the inexactness of GPS:
This gave me a bounding box (selecting the CSV format) of:
To query my GeoJSON, I opted to start with my Google Latitude traces, which cover the longest recent period in the most detail (because, in part, they were collected passively; I didn’t need to “check in” to record my presence); the GitSpatial URL I ended up with was this one and visiting it gave me – handily and happily – some more GeoJSON, which I could feed to the (very helpful) GeoJSON.io, which allowed me to double-check that everything worked as I wanted (it did):
With this GeoJSON in-hand, I then used some old-school UNIX command line magic to extract the number of unique dates in that file:
grep when taichigardens.geojson | cut -d" " -f10 | cut -d'"' -f2 | sort | uniq
That gave me a list of dates when I’d been inside that bounding box – and, likely, eating lunch at Tai Chi Gardens:
2010-01-16 2010-02-20 2010-05-29 2010-06-15 2010-06-19 2010-06-26 2010-06-28 2010-10-16 2010-11-17 2010-11-20 2011-03-31 2011-04-05 2011-04-11 2011-04-20 2011-06-11 2011-06-13 2011-09-06 2011-09-27 2011-11-14 2011-11-23 2011-11-30 2011-12-12 2012-05-14 2012-05-15 2012-05-16 2012-05-18 2012-06-05 2012-06-06 2012-07-30 2012-08-01 2012-08-03 2012-08-06 2012-08-08 2012-08-10 2012-09-10 2012-09-17 2012-09-21 2012-10-31 2012-11-05 2012-11-13 2012-11-22 2012-11-26
Piping that result through wc and I find out that over the period from January 16, 2010 to November 26, 2012 I visited Tai Chi Gardens 42 times:
grep when taichigardens.geojson | cut -d" " -f10 | cut -d'"' -f2 | sort | uniq | wc -l
This is just a toe dipped in the water of the experimenting I hope to do with my decades-long stretch of geopresence data. I welcome you to join me.