Upload
gareth-lloyd
View
826
Download
7
Embed Size (px)
DESCRIPTION
Introduction to GeoDjano. Django Weekend Cardiff
Citation preview
GeoDjango: Putting Django on the Map
Sunday, 9 February 2014
Tobler’s First Law of Geography:
"Everything is related to everything else, but near things are more related than distant things."
Tobler, W. (1970) "A computer movie simulating urban growth in the Detroit region". Economic Geography, 46(2): 234-240.
Sunday, 9 February 2014
Sunday, 9 February 2014
Here be dragonsSunday, 9 February 2014
Sunday, 9 February 2014
Sunday, 9 February 2014
• Install PostGIS (postgis.net/install/)
• You can use other dbs, but...
• Install libraries (docs.djangoproject.com/...)
• Add django.contrib.gis to INSTALLED_APPS and you’re hot to trot
Sunday, 9 February 2014
Defining GeoDjango Models
Sunday, 9 February 2014
Creating Geographically Related Instances
Sunday, 9 February 2014
One advantage of modelling geographic relationships this way:
Sunday, 9 February 2014
What’s in the database?
Sunday, 9 February 2014
GEOS Instances
Sunday, 9 February 2014
Using Spatial RelationshipsPossible places to check in
Nearest restaurant
Within user-defined area
Sunday, 9 February 2014
The closest bar I’ve been to before
The most popular bar in London
Sunday, 9 February 2014
Lookup Type PostGIS Oracle SpatiaLite MySQLbbcontains X X Xbboverlaps X X Xcontained X X Xcontains X X X Xcontains_properly Xcoveredby X X covers X X crosses X Xdisjoint X X X Xdistance_gt X X Xdistance_gte X X Xdistance_lt X X Xdistance_lte X X Xdwithin X X equals X X X Xexact X X X Xintersects X X X Xoverlaps X X X Xrelate X X Xsame_as X X X Xtouches X X X Xwithin X X X Xleft Xright Xoverlaps_left Xoverlaps_right Xoverlaps_above Xoverlaps_below Xstrictly_above Xstrictly_below X
Sunday, 9 February 2014
Time to output for the web
Sunday, 9 February 2014
The Admin Interface
Sunday, 9 February 2014
https://www.sharegeo.ac.uk/
Sunday, 9 February 2014
+ =
Sunday, 9 February 2014
+ =
Sunday, 9 February 2014
Postcodes
https://github.com/gareth-lloyd/postcode_latlng
Sunday, 9 February 2014
Thank you!
London Django Coding Session - Biweekly
Hosted by:
Conversocial - always hiring Django people
Sunday, 9 February 2014