6. GeoDjango
● GeoDjango is an included module for
geospatial data.
● It provides to make it as easy and simple as
possible to create geographic Web
applications, like location-based services.
10. Problems
■ Many data formats
✓ shp, geojson, GeoTIFF, PNG…
■ Representation of geospatial information on the model
✓ POINT, LINESTRING, POLYGON...
11. Problems
■ Many data formats
✓ shp, geojson, GeoTIFF, PNG…
■ Representation of geospatial information on the model
✓ POINT, LINESTRING, POLYGON...
< Hey, I have those features!
13. Main Features
■ Django model fields for ORG geometries and raster data
■ Extensions to ORM for querying and manipulating spatial data
■ Loosely-coupled, high-level Python interfaces for GIS geometry
and raster operations and data manipulation in different formats
■ Editing geometry fields from the admin
19. PostGIS 2+
A spatial database extender for PstgreSQL object-relational database.
It is the de facto standard of geospatial database.
■ Add GEOMETRY type to database
■ Many Vector and raster data functions included
■ Network Topology support
https://postgis.net/features/
20. Importing spatial data (model definition)
$ python manage.py ogrinspect world/data/TM_WORLD_BORDERS-0.3.shp
WorldBorder --srid=4326 --mapping --multi
# This is an auto-generated Django model module created by ogrinspect.
from django.contrib.gis.db import models
class WorldBorder(models.Model):
fips = models.CharField(max_length=2)
iso2 = models.CharField(max_length=2)
:
geom = models.MultiPolygonField(srid=4326)
25. Conclusion
■ Geodjango is handy module for handring geospatial data
✓ Building into the same Django you can already know
✓ Supported GEOMETRY type
✓ Extensions to ORM for querying and manipulating spatial data
✓ manage.py for geodjango: simple spatial data definition and
import function
✓ Editing geometry fields from the admin