Habitat - Fosdem 2015 talk
This is the talk I gave at Fosdem 2015 about a proof-of-concept
personal datastore called Habitat.
My name is Richard Pope, and I am going to talk to you about a proof of concept service I'm building called Habitat. Habitat is a self hosted, programmable geospatial datastore, or a kind of digital assistant, an external brain like google now or IFTT. Or rather it could be, for now Habitat is just a proof of concept to try and scratch some particular itches:
What we consider to be personal data is going to change to include things like our mental model of our neighbourhood. Hint: it's probably about a 15 minute travel form where you live, but it will be different for everybody, or the hash of your journey to work each day. This stuff is too important to loose control of for the sake of pure convenience.
As software becomes more woven into our lives, context and push will will come to define user interfaces. Mice, keyboards, activly visiting websites are on the wane. That certainly seems to be the play Google Now, Facebook, EasilyDo, Amazon are all making anyway. Geospatial/location feels like the most important context in that world.
A web page on your mobile phone knows where it is on the planet, which way it is orientated, where it is in 3d space, how much battery it has, how close it is to your face and what the ambient light is. Who will be the broker for all the data you are generating?
Cucumber tests can be used for much much more than testing software. They will be used to verify public datasets and as a user interface onto changing datasets. This photo is from a hack day organised by the UK Environment Agency, exploring the idea of using cucumber tests to check for environmental breaches in open environmental data.
OpenStreetMap's value is not in the map, it's in the data. The polygons represent an open, queriable land use map of the whole planet, and you can do some interesting things with that. This was an experiment I did to build an api for testing if I was indoors or outside by loading the outlines of London buildings into a mongo db instance.
Habitat is a self hosted, personal, programmable geospatial data store.
The tests look like this... WHEN I am with in 100m of [XXX,XXX] then ping the url example.com/tad-ah
Now, that is about the limit of what I've actually implemented, it is a proof of concept, which I'll show you in a minute, but the idea is to be able to do other things.
So taking public data, for example about the weather, and building alerts based on location - so if I'm in a park (OpenStreetMap polygons define what areas are parks), and the weather (from the Met Office API) looks liek rain, then send me an SMS.
Eventually it could be used for much more complex use-cases like powering a thing I made called the bicycle barometer (which currently runs on bespoke code).
A quick word on what it is build with, then a demo. Habitat is built using Flask, a Python framework, and exposes an oAuth secured API using Flask Restful and Flask oAuthLib. It stores personal and public data in a MongoDB database, and runs cucumber tests against the data using Behave and Celery.
There are currently client apps for reporting your location and editing cucumber tests.
The server itself doesn't have much of an interface, you can just login and see what apps have been granted access.
This is an example client for writing cucumber tests. In this instance, I'm going to amend the latitude and longitude where this test is triggered.
This is an example (very basic) client for reporting a single location. Really this should be a native mobile app running in the background continually reporting my location.
Reporting the location causes the cucumber test to be run, and you can see it running successfully.