The Geo-aware Parent

14
The Geo-Aware Parent Matt Machell for Multipack Presents Feb 2011

description

10 minutes on my little web app for parents.

Transcript of The Geo-aware Parent

Page 1: The Geo-aware Parent

The Geo-Aware ParentMatt Machell for Multipack Presents

Feb 2011

Page 2: The Geo-aware Parent

It started when I became a dad

Page 3: The Geo-aware Parent

What if I had a web app to find child-friendly places?

Page 4: The Geo-aware Parent

So I made a prototype using Javascript

Page 5: The Geo-aware Parent

Python

• code.google.com/edu/languages/google-python-class/

• diveintopython.org/

Page 6: The Geo-aware Parent

Let’s Build This With : Pylons

• More mix-n-match than Django

• Good docs but some gaps

• pylonshq.com

• pylonsbook.com

Page 7: The Geo-aware Parent

Up and running...python go-pylons.py mydevenv

source mydevenv/bin/activate

easy_install sqlalchemy

easy_install mako

paster create -t pylons parents

paster controller locations

paster serve development.ini --reload

Page 8: The Geo-aware Parent

Geo-locating

• Code is really easy

• Slow on desktops without GPS

• Now in FF, Safari, Opera and IE!

Page 9: The Geo-aware Parent

if(navigator.geolocation){

navigator.geolocation.getCurrentPosition(function(position) {

var lat=position.coords.latitude;

var long=position.coords.longitude;

window.location=window.location+'?geo='+lat+','+long;

}, function() {

//failure

},

{maximumAge: 75000});

}

Page 10: The Geo-aware Parent

Haversine Formulas

• Cos the world isn’t flat

Page 11: The Geo-aware Parent

Geocoding

• Need to match name to lat/long

• Need to match lat/long to name

• Need to match postcode to lat/long

Page 12: The Geo-aware Parent

Geonames Rocks!

• Web Service APIs in JSON/XML/etc

• Country specific targeting

• Postcodes

• www.geonames.org

Page 13: The Geo-aware Parent

Interface

• Part of my “New Dad Site” blog

• Lightweight HTML5, mostly forms

• CSS3 transitions tied to :invalid

Page 14: The Geo-aware Parent

Some Assembly Required

• finder.newdadsite.com

• @shuckle / @newdadsite

• eclecticdreams.com