The Geo-aware Parent
-
Upload
matt-machell -
Category
Technology
-
view
1.165 -
download
1
description
Transcript of The Geo-aware Parent
The Geo-Aware ParentMatt Machell for Multipack Presents
Feb 2011
It started when I became a dad
What if I had a web app to find child-friendly places?
So I made a prototype using Javascript
Python
• code.google.com/edu/languages/google-python-class/
• diveintopython.org/
Let’s Build This With : Pylons
• More mix-n-match than Django
• Good docs but some gaps
• pylonshq.com
• pylonsbook.com
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
Geo-locating
• Code is really easy
• Slow on desktops without GPS
• Now in FF, Safari, Opera and IE!
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});
}
Haversine Formulas
• Cos the world isn’t flat
Geocoding
• Need to match name to lat/long
• Need to match lat/long to name
• Need to match postcode to lat/long
Geonames Rocks!
• Web Service APIs in JSON/XML/etc
• Country specific targeting
• Postcodes
• www.geonames.org
Interface
• Part of my “New Dad Site” blog
• Lightweight HTML5, mostly forms
• CSS3 transitions tied to :invalid
Some Assembly Required
• finder.newdadsite.com
• @shuckle / @newdadsite
• eclecticdreams.com