The [http://code.djangoproject.com/browser/django/branches/gis gis] branch intends to add a contrib app implementing geographic support. = What's GIS? = * [http://cfis.savagexi.com/articles/category/gis Series of blog posts] giving intro to GIS; choice quote from [ first post]: "If you feel like ending a conversation with a developer then simply bring up the topic of character encodings ... [o]r ... coordinate systems. ... So in the spirit of Tim Bray's and Joel Spolsky's wonderful writeups of character encodings, I thought I'd put together a basic survival guide to coordinate systems over my next few posts and then tie it back to Google Maps." * More on [http://en.wikipedia.org/wiki/Map_projection map projections], including why people can't agree on just one (utf-8). = Useful code = * [http://postgis.refractions.net/ PostGIS], the [http://www.opengis.org/docs/99-049.pdf OpenGIS SQL Types (pdf)] implementation for Postgresql * [http://geos.refractions.net/ GEOS], low-level C++ port of [http://www.jump-project.org/project.php?PID=JTS Jave Topology Suite], used by PostGIS * [http://exogen.case.edu/projects/geopy/ Geopy] calcs distances using (very accurate) [http://www.movable-type.co.uk/scripts/LatLongVincenty.html Vincenty], and uses the [http://en.wikipedia.org/wiki/World_Geodetic_System WGS 84] datum. = Questions = = Alternatives = = Implementation = == Phase 1 == Assume existing data and fields, and that the == Custom Manager == A custom manager (and queryset) to support lookups like: {{{ Schools.objects.filter(geom__overlaps=bbox.geom) # && Schools.objects.filter(geom__contains=bbox.geom) # ~ Schools.objects.filter(geom__sameas=bbox.geom) # ~= Schools.objects.filter(geom__inside=bbox.geom) # @ }}} == Field Types == Field type for a geometry == GIS wrapper == wrapper for geos, have the ability to do something like {{{ from django.contrib.gis import area area(bbox.geom) }}}