Justin Bronn, CartoAnalytics

Geodjango for rapidly creating online applications. Going to discuss:

  1. Why
  2. Commoditization
  3. Abstraction
  4. Rapid Development

“Why” “80% of enterprise data has a spatial component” Even if it’s 20%, there’s a lot of spatial data out there. Tends to be highly self-correlated. “near things are more related than distant things” - [missing citation].

In law school, created “Houston Crime Maps”, using django. Wanted to put hacks into cohesive package for putting geo-data online.

“Commoditization” Server operating systems - Solaris, HP-ux, SGI, SCO, AIXL - siloed, but faded into the background as Linux has been adopted in the mainstream.

Similarly databases, big names have been replaced by PostgreSQL and MySQL.

“Abstraction” Django revolves around “MTV”:

  • Models - roughly correspond to DB tables, GeoDjango allows geo specific fields.
  • Templates - presentation layers, HTML & JavaScript
  • Views - Business logic, simple pyhon functions

GeoDjango sits on top of spatial database (PostGIS, Oracle spatial and MySQL spatial) Python ctypes library interacts with GDAL, GEOS, PROJ.4 and provides high level interfaces to make accessing them easily. ctypes gives wide cross-platform compatability.

On top of that are a layer of standards, can export to KML, GML, WKT, GeoJSON, GeoRSS. Can then leverage OpenLayers or other mapping APIs to create complete geo stack.

  1. Rapid Development

Example of spatial query using geodjango, 2 fairly simple lines. Shows the SQL for it, 7 large and complicated lines of SQL .

Allows you to harness the power of spatial data.

[Demo]

Django has automatic admin interface. Available for all of the models that you’ve defined. You can specify fields to use for search. Demo shows searching for San Francisco and returning neighborhoods within it. Selecting “Downtown”. Can access the basic fields: Name, State, City, Country. Can also have a geographic admin. OpenLayers with OSM base layer, the neighborhood is highlighted as a polygon. Can be manipulated live in the database by dragging polygons.

GeoDjango: Web Applications for (Neo)Geographers with Deadlines

Technorati tags: geodjango, django, where, where2.0, where2008