Wednesday, September 09, 2009

GeoDjango

This talk helps me integrate many themes from these blogs. Our speaker, Adam Fast, is from Lawrence, Kansas, the Django HQS.

He's showing some really cool geodjango apps that he's worked on, including one with all the bird strike data coming from the nation's airports.

He uses PostGIS with Postgres. MySQL is really quite deficient in this area. django.contrib.gis and a custom test runner are needed. Set some POSTGIS stuff in settings.py. You'll have these different field types in models. You need objects = models.GeoManager(). You can start getting points on maps right in the custom Admin.

GeoPy is a great dependency for talking to the different map service back ends, e.g. Google's and Yahoo's. It's really easy to do polygon stuff, like with zip codes. His example uses 97214. Distance lookups are also easy.

So shouldn't Urban Edibles be a GeoDjango application? Maybe it is at this point. I've been out of that loop.

This is the kind of free stuff we need in Portland Public Schools. Yes, we'll need lots of scaffolding to get set up. A lot of that is already available in the form of tutorial code on the web. These geographic coordinate systems aren't going away and the resources are plentiful.

Advice re some of the gotchas: geometries are big, maybe use .defer(). You don't want huge data sets going over the wire with every page request. Xapian and SOLR might help with search down the road but for now searching isn't as straightfoward as it might be.

This stuff is really cool. Is anyone at PSU a GeoDjango expert? I went up after the talk to ask some questions about ramping up from inside IDLE at first, then moving to a dev server for maps 'n stuff. Adam thought that'd be highly doable. PyGeo by itself, without Django at all, would be a good place to start, for like the stuff we were doing at Winterhaven in 2006.

Clever tweet: jtauber RT @dartdog: it is about to be 09-09-09-09 must be a continuation of @jtauber 's plot at #Djangocon ....