SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
8.
models.py
from django.db import models
class City(models.Model):
name = models.TextField()
class UserGroup(models.Model):
name = models.TextField()
city = models.ForeignKey(City)
started = models.DateField()
def join(self, user):
# add user to group
10.
views.py
def user_groups(request, city_name):
city = City.objects.get(name=city_name)
groups = UserGroup.objects.filter(city=city)
return render(request, 'user_groups.html',
{'groups': groups})
11.
user_groups.html
{% extends "base.html%}
<ul>
{% for group in groups %}
<li>
{{ group.name }}
</li>
{% endfor %}
</ul>
12.
What is GeoDjango?
“world-class geographic Web framework”
included in Django core
Combine existing Python & DB tools with
standard API
but first …
13.
Some GIS Problems
The Earth is not a sphere!
How to store & query efficiently
Vendor implementations
Wide range of data formats
Tiger/LINE, Shapefiles, E00, OGR, GeoJSON,
WKT, EWKT, EWKB, GML, KML, OSM, GLOBE,
TIFF, ArcGrid ….