Change the future

Saturday 2:35 p.m.–3:05 p.m.

Location, Location, Location

Julia Grace

Audience level:
Web Frameworks


Are you building a Django application that needs to handle geographic location data? Are you unsure how to tackle using spatial databases, how to jump into using GeoDjango or how to allow users to query for data by, for example, zip code? I'll go over how to use GeoDjango, lessons learned in using spatial databases, and how I built an API exposing distance query functionality.


This talk targets location novices who are either building a new Django application or converting an existing Django application to use spatial databases and GeoDjango.

I'll first go over how our application handled thousands of locations (including international locations) as tuples of strings and why this was very easy at first but problematic in the long run.

Next up I'll discuss the options available when migrating to a spatial database, what was involved from a data migration standpoint (and how to design your schema & models if your building from scratch), and how I made use of GeoDjango in my Django 1.4 application on top of PostgreSQL 9.2 with PostGIS 2.0. I will also go over methods of normalizing and persisting user-entered location data (via geocoding using various publicly available APIs, such as the Google Geocoding API).

Finally I'll talk about how to query your geographic data, such as how you allow users to search by distance and how I built an API to (using TastyPie) to allow 3rd parties to query by distance.