Habitat - Fosdem 2015 talk

11 February 2015

This is the talk I gave at Fosdem 2015 about a proof-of-concept
personal datastore called Habitat.

Slide 1 - Habitat - A programmable personal geospatial datatoreGeospatial devroom - Fosdem 2015 Richard Pope

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:

Slide 2 - Our mental models of our environment are personal data- map of where I live with outline of what I consider my neighbourhood

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.

Slide 3 - Context and push - photo of Google Now push alert on a pebble watch

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.

Slide 4 - Mobile web and sensors - screen grab of github repo showing list of HTML5 APIs including battery status and page visibility

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?

Slide 5 - Cucumber tests are not just for testing - photo of hand written cucumber test about ammonia levels in the River Avon

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.

Slide 6 - The real value in OpenStreetMap is in the polygon - photo of a phone showing a test web page

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.

Slide 7 - Schematic of how Habitat works - core server with input and editing apps accessing it via oauth, outputting various actions

Habitat is a self hosted, personal, programmable geospatial data store.

Slide 8 - Example cucumber test - Scenario: Near a point in space    When I am within 100 meters of "[0,0]"    Then ping "http://example.com/tad-ah"

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.

Slide 9 - Example cucumber test - Scenario: In a park and rain dueWhen I am in a “park” and the weather looks like “rain” Then send an sms “RAIN!!!”"

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.

Slide 10 - Scenario: Bicycle barometer When I am “at home” and the weather looks like “snow” and the tube status of the “Victoria Line” is “good”Then ping “http://barometer.memespring.co.uk?value=10”"

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).

Slide 11 - Annotated schematic of Habitat"

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.

Slide 12 - Demo"

Demo Gif: editor client, edit a cucumber test"

The server itself doesn’t have much of an interface, you can just login and see what apps have been granted access.

Demo Gif: location client - report client and then see test run successfully"

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.

Demo Gif: Singing into the server"

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.

Slide 12 - Thanks"