Вы находитесь на странице: 1из 2

Geomatics Workbooks n° 12 – "FOSS4G Europe Como 2015"

Raster Data in Django


Daniel Wiesmann1 and Mike Flaxman2
1
Urbmet Limited, Lisbon, Portugal
2
Geodesign Technologies Inc, San Francisco, California, USA

Abstract
Integrating raster data in modern web applications is challenging even for
experienced web developers. Existing software to create raster based GIS web
services are not directly integrated into modern web frameworks such as
Django, Ruby on Rails, or Drupal. Developers striving to create online GIS
services including raster data are often bound to learn, install and maintain
software external to their main web framework.
In this talk we present first results of our ongoing effort to integrate raster data
into GeoDjango, the GIS module of the Django web framework. Django is a
popular modern web framework written in the Python programming language
(Django Software Foundation [DSF], 2015a). It contains a GIS module called
GeoDjango which has the goal to "make it as easy as possible to build GIS Web
applications and harness the power of spatially enabled data” (DSF, 2015b).
GeoDjango has custom bindings to GDAL (2015) and GEOS (2015) and
connects to multiple spatial backends (PostGIS, MySQL, Oracle Spatial and
SpatiaLITE). It has extensive GIS capabilities for vector data, but did not have
any support for raster data up to the current release (Django 1.7).
In collaboration with Django core developers, we have contributed to adding
basic raster bindings to the GDAL interface of Django, which will be released in
version 1.8 of Django (DSF, 2015c). Creating the bindings to the GDAL raster
capabilities was the first step in adding raster as a data type into the Django
model structure (DSF, 2015d). The goal for the Django 1.9 release is to add a
Raster Field to Django, which will allow writing and retrieving raster data with
the same ease as writing ordinary text or numerical data.
Our contribution to this raster integration is inspired by our applied work with
raster data in large scale scenario planning. For our applied work, we have
been developing a plugin to Django as an external python package called
django-raster (Wiesmann & Flaxman, 2015), which we are actively using in our
applications. The package still relies on GDAL's own Python bindings, but
otherwise functions similarly to what is being integrated directly into Django.
Through our real world use cases, we identify the main difficulties in serving
rasters through Django early on. Furthermore, we develop and test essential
features that will be necessary in any applied case such as color-schemes and
legend generation. With the django-raster package, and the upcoming deeper
integration into GeoDjango and the Django web framework, the creation of
raster based online services such as Web Map Services or Tile Map Services
becomes relatively straightforward, even for web developers with limited GIS
experience.

629
Geomatics Workbooks n° 12 – "FOSS4G Europe Como 2015"

At the end of our talk, we showcase how we serve raster tiles through Django in
our applied work.

References
✔ Django Software Foundation. (2015a). Django – The web framework for
perfectionists with deadlines. Retrieved March 9, 2015, from
https://djangoproject.com/
✔ Django Software Foundation. (2015b). GeoDjango. Retrieved March 9,
2015, from https://docs.djangoproject.com/en/dev/ref/contrib/gis/
✔ Django Software Foundation. (2015c). Django 1.8 Release Notes. Retrieved
March 9, 2015, from https://docs.djangoproject.com/en/dev/releases/1.8/
✔ Django Software Foundation. (2015d). Add a RasterField to GeoDjango.
Retrieved March 9, 2015, from
https://code.djangoproject.com/ticket/23804/
✔ GDAL. (2015). Geospatial Data Abstraction Library. Retrieved March 9,
2015, from http://gdal.org/
✔ GEOS. (2015). (Geometry Engine - Open Source). Retrieved March 9, 2015,
from http://geos.osgeo.org
✔ Wiesmann, D. & Flaxman, M. (2015). Django-raster python package.
Retrieved March 9, 2015 from https://github.com/geodesign/django-raster

630

Вам также может понравиться