SlideShare ist ein Scribd-Unternehmen logo
1 von 113
DJANGO 101 + GEODJANGO
        why it rocks
CALVIN CHENG
     www.calvinx.com
www.od-eon.com/blogs/calvin
Stefan Talpalaru                  Liviu Bogdan Chiributa   That’s Me! :-)
Odeon Consulting Group            Odeon Consulting Group   Odeon Consulting Group




                         + ........
1   Django Basics


          2   GeoDjango


                    3   Why It Rocks
1
Django Basics
HTTP request
          (POST, GET)


                                        HTTP response
     urls.py
                    (1)
(url definitions)             views.py          (5)         *.html
                            (“controller”)              (HTML template)
                                                (4)
                            (2)        (3)

                             models.py

                          DB agnostic ORM

                              Actual
                             Database
Python
urls.py
views.py
templates (*.html)
models.py
settings.py
Shared Hosting: Webfaction
VPS: Linode
VPS: Slicehost
Cloud: Amazon EC2
2
GeoDjango
REDDCalculator.com (Beta)         SEC (Closed Beta)




                                                          LUC
                                                      (Coming Soon!)




                                                !



          ENVIRONMENTAL iTOOLS
 Spatially Explicit Scenario Analysis: Norway-Indonesia’s Forest Moratorium
 Species Extinction Calculator (SEC)
 Land Use Calculator (LUC)
SPECIES WHA--??
Species Extinction Calculator (SEC)
4%




                       4"
&'#()#*%
           123#
              !"#$$%&'()*"+,-./0"



            !"#$%
3,000


                       2,250


   Number of species   1,500


                        750


                          0
                               100   200   300       400       500        600   700   800
                                                 Area conserved (km sq)




                                     SPECIES-AREA
More habitats conserved (Area) = More fauna diversity (Species)
+)
!) )
 &,-




! )
    *
 "#$%$&'(
            ( )
             .
             &,-




             .
                 )
             "#$%$&'(
                        )
!"#$%&'()3+(451"67(&/&012(

                     !"#$%&'()*+(,-.&(&/&012(
0$1,23+4")56)'."+4,2+"+'*,'7$2/+)$4"'8$*.51'

                   !"#$%&"'"(")*+',-'-,."+*'"/#"+'
                                                                   N
                                                            # $ % "i $ ! i
                                                                  i =1

!                              -
                                                     M




                           (                                )
                                        #% "!$ j
        )              )                )
                   *
    &+,                              &+,             j =1




!                                     -                )
               )
    "#$%$&'(                                "#$%$&'(
MATRIX-CALIBRATED SPECIES-AREA
Accounts for taxon-specific responses to different components of the landscape
EXAMPLE OF AN AREA?
Conservation Forests, National Reserves etc
    Borneo 743,330 square kilometres
USERS AND USE-CASE
Conservation scientists and Land owners define areas which are
conserved by plotting polygons on a map source (e.g. Google Maps).

Areas which are slated for development are also marked.

By quantifying area conservation goals (areas conserved before and after
development) and its impact on the loss of species, SEC is a tool which
helps people make better trade-off decisions.
USERS AND USE-CASE
REDDCalculator.com computes the socio-economic trade-offs and
results as a consequence of the Norway-Indonesia REDD+ Moratorium.
Layers & Features (‘Vector Objects’)
 jQuery &
OpenLayers                                                    User Interface
                              Map Source


KML   GML    WKT     GeoJSON          GeoRSS        Others    Data (serialized)

               GeoDjango                                       Python Logic


                                                              C/C++ Libraries
                                                             w/ Python Bindings
                                                                & Datastore
(2.7)
(trunk)
sudo -u postgres psql -d yourdatabase_name -f { ... }/postgis.sql

sudo -u postgres psql -d yourdatabase_name -f { ... }/postgis_comments.sql

sudo -u postgres psql -d yourdatabase_name -f { ... }/spatial_ref_sys.sql
sudo -u postgres psql -d yourdatabase_name -f /opt/local/var/macports/
software/postgis/1.5.2_1+postgresql90/opt/local/share/postgresql90/
contrib/postgis-1.5/postgis.sql

sudo -u postgres psql -d yourdatabase_name -f /opt/local/var/macports/
software/postgis/1.5.2_1+postgresql90/opt/local/share/postgresql90/
contrib/postgis-1.5/postgis_comments.sql

sudo -u postgres psql -d yourdatabase_name -f /opt/local/var/macports/
software/postgis/1.5.2_1+postgresql90/opt/local/share/postgresql90/
contrib/postgis-1.5/spatial_ref_sys.sql
Portage exists
But here’s a magical way - https://github.com/stefantalpalaru/dotfiles/
tree/master/Gentoo/custom%20overlay/portage/dev-db/postgis -
custom postgis ebuild modified by Stefan
add ebuild to local ‘overlay’ (a gentoo terminology)
emerge postgis
edit configuration file in /etc/conf.d/postgis and add in the postgresql
database that you need ‘postgis-enabled’
emerge --config postgis
# settings.py

INSTALLED_APPS = (
  # Core Django Apps
  'django.contrib.contenttypes',
  'django.contrib.auth',
  'django.contrib.sessions',
  'django.contrib.sites',
  'django.contrib.admin',
  'django.contrib.admindocs',
  'django.contrib.flatpages',
  'django.contrib.humanize',
  'django.contrib.comments',
  'django.contrib.markup',
  'django.contrib.webdesign',
  'django.contrib.sitemaps',

    'django.contrib.gis',
    # Custom Apps for REDDCalculator.com
    'updatemodel',
    'location',
    'areadata',

    # Generic and reusable apps for most projects
    'south',
    'django_cherrypy_odeon',
    'misc',
    'cron',
    'notify',
    'log',
    'homepage',
    'userprofile',
)
# settings.py

DATABASES = {
        'default': {

           'ENGINE':
             'django.contrib.gis.db.backends.postgis',
           ‘NAME’: ‘yourdatabase_name’,
           'USER': 'yourdatabase_user’,
           'PASSWORD': 'yourdatabase_password',
           'HOST': 'your_ip_or_domain',
    }
}
Django
GeoModel
 & APIs
from django.contrib.gis.db import models
from django.contrib.gis.db import models

class Province(models.Model):
   name = models.CharField(max_length=256)
   name_long = models.CharField(max_length=256, null=True)
   island = models.ForeignKey(Location, null=True)
   geom = models.MultiPolygonField(srid=4326, null=True)
   objects = models.GeoManager()
from django.contrib.gis.db import models

class Province(models.Model):
   name = models.CharField(max_length=256)
   name_long = models.CharField(max_length=256,
null=True)
   island = models.ForeignKey(Location, null=True)
   geom = models.MultiPolygonField(srid=4326, null=True, 
           geography=True)
   objects = models.GeoManager()
What are the geometry fields available to us in django?
GEOS: OGC simple feature implementation

 PointField
 MultiPointField

 LineStringField
 MultiLineStringField

 PolygonField
 MultiPolygonField

 GeometryCollectionField
PointField




         (x, y)
MultiPointField




((x1, y1), (x2, y2), (x3, y3))
LineStringField




((x1, y1), (x2, y2), (x3, y3), (x4, y4))
MultiLineStringField




(((x1, y1), (x2, y2), (x3, y3), (x4,
     y4)),((x5, y5), (x6, y6)))
PolygonField




((x1, y1), (x2, y2), (x3, y3), (x4, y4), (x1, y1))
MultiPolygonField




((x1, y1), (x2, y2), (x3, y3), (x4, y4), (x1, y1)),
     ((x5, y5), (x6, y6), (x7, y7), (x5, y5)))
GeometryCollectionField




((x1, y1), (x2, y2), (x3, y3), (x4, y4), (x1, y1)),
          ((x5, y5), (x6, y6), (x7, y7)),
                    ((x8, y8)))
Practical Example #1: Species Extinction Calculator
Practical Example #2: REDDCalculator.com
from django.contrib.gis.gdal import datasource, spatialreference
from django.contrib.gis.geos import multipolygon, geosgeometry

shapefile = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../../../../proj_public/media/files/giveshapefile.shp'))

ds = DataSource(shapefile)

layer = ds[0] # Checked in Python shell that this has only 1 layer
from django.contrib.gis.db import models

class AreaData(models.Model):
   district = models.ForeignKey(District) # District is FKed to Province
   land_use = models.IntegerField(choices=VEGETATION_TYPES)
   allocation = models.IntegerField(choices=
                                   CHOICES['LAND_ALLOCATION'])
   intact = models.IntegerField()
   concession = models.CharField(max_length=255, blank=True)
   peat = models.CharField(max_length=255, blank=True)
   area = models.FloatField(help_text='hectares')
   fid = models.IntegerField()
   # ... and any other.
   geom = models.MultiPolygonField(srid=4326, null=True)
   objects = models.GeoManager()
area = AreaData.objects.get(fid = feature.fid)
geometry_name = feature.geom.geom_type.name
geometry_object = feature.geom.transform(SpatialReference(4326),
clone=True).geos

# update our area object with the geom data from our shape file
if geometry_name == 'Polygon':
    # If our geometry object is a Polygon, we cast as MultiPolygon first
    geometry_object = MultiPolygon(geometry_object)

area.geom = geometry_object
area.save()
Geospatial
 Libraries
GEOS   GDAL   PROJ.4


  Mapnik   GeoIP
Utilities
LayerMapping




./manage.py ogrinspect       ./manage.py ogrinfo
./manage.py ogrinspect
         and
    LayerMapping
$ ./manage.py ogrinspect ../proj_public/media/files/redd_data/
kalimantan_universe.shp Location --srid=4326 --mapping

# This is an auto-generated Django model module created by ogrinspect.
from django.contrib.gis.db import models
class Location(models.Model):
   island = models.CharField(max_length=50)
   geom = models.MultiPolygonField(srid=4326)
   objects = models.GeoManager()

# Auto-generated `LayerMapping` dictionary for Location model
location_mapping = {
   'island' : 'island',
   'geom' : 'MULTIPOLYGON',
}
# models.py
from django.contrib.gis.db import models

class Location(models.Model):
   island = models.CharField(max_length=50)
   geom = models.MultiPolygonField(srid=4326)
   objects = models.GeoManager()

# Auto-generated `LayerMapping` dictionary for Kalimantan model
location_mapping = {
  'island' : 'island',
  'geom' : 'MULTIPOLYGON',
}
import os
from django.contrib.gis.utils import LayerMapping
from django.contrib.gis.gdal import DataSource
from location.models import Location, location_mapping

shapefile = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../../../../proj_public/media/files/kalimantan_universe.shp'))
ds = DataSource(shapefile)
layer = ds[0] # Checked in Python shell that this has only 1 layer
kalimantan = LayerMapping(Location,
                                  shapefile,
                                  location_mapping,
                                  transform = True,
                                  encoding='iso-8859-1')
kalimantan.save(strict = True, verbose = True)
Get your Polygon showing up for Free! GeoAdmin FTW
from django.contrib.gis import admin as geoadmin
from location.models import Location

admin.site.register(Location, geoadmin.GeoModelAdmin)
OpenLayers
“ OpenLayers is a pure JavaScript library for
  displaying map data in most modern web browsers,
  with no server-side dependencies. ”
jQuery
(mobile)
“ jQuery Mobile is a Touch-Optimized Web
  Framework for Smartphones and Tablets. ”
+   +
$(document).ready(function(){
  $('#map_delete').hide()

  // Define a custom styles which will be used by our polygon layer
  var style = $.extend(true, {}, OpenLayers.Feature.Vector.style['default']) // get a copy of default style
  style.pointRadius = 15
  var styleMap = new OpenLayers.StyleMap({"default": style})

  // Define a custom style which will be used by our background layer
  var backgroundStyle = $.extend(true, {}, OpenLayers.Feature.Vector.style['default']) // get copy
  backgroundStyle.fillOpacity = "0.1"
  backgroundStyle.fillColor = "#000000"
  backgroundStyle.strokeColor = "#999999"
  var backgroundStyleMap = new OpenLayers.StyleMap({"default": backgroundStyle})

  // Define our background layer
  backgroundLayer = new OpenLayers.Layer.Vector("Background Layer", {styleMap:
backgroundStyleMap} )
// Define our vector layer
polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer", {styleMap: styleMap})
polygonLayer.events.on({
   'featureselected': show_delete_button,
   'featureunselected': hide_delete_button
})

// Define our toolbar, panels and associated controls
// pinch and zoom is defined in touch navigation
var touchNavigation = new OpenLayers.Control.TouchNavigation({
   dragPanOptions: {
      interval: 100,
      enableKinetic: true
   }
})

// define our zoom panel
var zoomPanel = new OpenLayers.Control.ZoomPanel()

// define our layer switcher
var layerSwitcher = new OpenLayers.Control.LayerSwitcher()
// controls
drawControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.Polygon,
                                                       { displayClass: 'olControlDrawFeaturePolygon'});
selectControl = new OpenLayers.Control.SelectFeature(polygonLayer,
                                                       { clickout: true });
editControl = new OpenLayers.Control.ModifyFeature(polygonLayer,
                                                       { selectControl: selectControl,
                                                         vertexRenderIntent: 'temporary',
                                                         displayClass: 'olControlModifyFeature'});
// define our custom control tool bar
var toolbar = new OpenLayers.Control.Panel({displayClass: 'olControlEditingToolbar'});
toolbar.addControls([
    //this control is just there to be able to deactivate the drawing tools and pan the map
    drawControl,
    editControl,
    new OpenLayers.Control({ displayClass: 'olControlNavigation' })
]);
// Define Map Layers
var gphy = new OpenLayers.Layer.Google("Google Physical", {type: google.maps.MapTypeId.TERRAIN});
var gmap = new OpenLayers.Layer.Google("Google Streets", {numZoomLevels: 20});
var ghyb = new OpenLayers.Layer.Google("Google Hybrid", {type: google.maps.MapTypeId.HYBRID,
                                                             numZoomLevels: 20});
var gsat = new OpenLayers.Layer.Google("Google Satellite", {type: google.maps.MapTypeId.SATELLITE,
                                                             numZoomLevels: 20});

// Feed the controls and layers defined above to our map object
map = new OpenLayers.Map({
   div: 'map',
   controls: [zoomPanel, touchNavigation, layerSwitcher, toolbar],
   layers: [ghyb, gphy, gmap, gsat, backgroundLayer, polygonLayer]
})
// Google.v3 uses EPSG:900913 as projection, so we have to transform our coordinates
 mapProjection = map.getProjectionObject()
 map.setCenter(new OpenLayers.LonLat(map_center_lon, map_center_lat).transform(defaultProjection,
mapProjection), map_zoom)

   // if there's a Total Landscape Area polygon, we will draw it on the backgroundLayer.
   if (background_coords_json){
       var pointList = []
       for (var i=0; i<background_coords_json.length; i++) {
          var point = new OpenLayers.Geometry.Point(background_coords_json[i][0], background_coords_json[i]
[1])
          pointList.push(point.transform(defaultProjection, mapProjection));
       }
       var linearRing = new OpenLayers.Geometry.LinearRing(pointList)
       totalAreaPolygon = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]))
       backgroundLayer.addFeatures([totalAreaPolygon])
   }
// draw the existing features into the polygonLayer
  var loaded_features = []
  for (var i=0; i<list_of_coords_json.length; i++) {
     var pointList = []
     for (var j=0; j<list_of_coords_json[i].length; j++) {
        var point = new OpenLayers.Geometry.Point(list_of_coords_json[i][j][0], list_of_coords_json[i][j][1])
        pointList.push(point.transform(defaultProjection, mapProjection));
     }
     var linearRing = new OpenLayers.Geometry.LinearRing(pointList)
     var polygonFeature = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Polygon([linearRing]),
                                                           {fid: list_of_coords_ids_json[i]})
     loaded_features.push(polygonFeature)
  }
  polygonLayer.addFeatures(loaded_features)
  polygonLayer.events.on({ "featuremodified": polygonSave, "featureadded": polygonSave,
       "vertexmodified": adjustVertex, "sketchstarted": adjustVertex, "sketchmodified": adjustVertex })

  // confirmation dialog
  $('#project_map_delete_polygon_yes').click(delete_polygon)
})
/* END of $(document).ready() */
Possibilities
1. Offline Maps for Field Usage

   2. Remote Controlled UAV for data collection

3. Crunch collected data and generate visualizations
Offline Maps for Field Usage
Layers & Features (Saved Locally, Syncing)
   Native
iOS/Android                                                            Native?
                      Map Source (Local Map Tiles)


KML   GML     WKT      GeoJSON        GeoRSS       Others       Data Transfer

                GeoDjango                                      Python Logic


                                                              C/C++ Libraries
                                                             w/ Python Bindings
                                                                & Datastore
The Problem with iOS MapKit Framework


MKMapView class implements Google Maps API natively

Unfortunately, Google Maps terms of use prevents us from caching
or storing map tiles locally
Alternative? https://github.com/route-me/route-me


Supports many map sources - OpenStreetMap, Microsoft
VirtualEarth, CloudMade, OpenAerialMap, OpenCycleMap,
SpatialCloud

OpenStreetMap permits map tile caching and local storage

Supports 2 offline, database-backed formats DBMap and MBTiles
A Comparison


                          MKMapKit     Route-Me

 Embed in iOS App           YES          YES

     Interaction            YES          YES

   Geolocalization          YES          YES

Different Map Sources       NO           YES

    Offline Maps            NO           YES
The Problem with Android Google Maps Framework


Renders Google Maps of course

Support for alternative map sources is important
Alternative? https://github.com/camptocamp/android-gis.git


 Supports many map sources - OpenStreetMap, Microsoft
 VirtualEarth, CloudMade, OpenAerialMap, OpenCycleMap,
 SpatialCloud

 OpenStreetMap permits map tile caching and local storage

 Supports 2 offline, database-backed formats DBMap and MBTiles
Benefits
  Fast
  (obviously, since Map Tiles are stored locally)
  100% Offline
  Stored as blob data for SQLite Client Access
Remote Controlled UAVs?
Collect Real Data

                             =>

         Effects on Landscape Change on Species
       e.g. obtain actual change in Forest Boundaries
(instead of just predicting on map on current prediction tool)
Prediction is great.

But we want real world data from primary forests!
http://www.youtube.com/watch?v=xjLXL72Medw&feature=autoshare
Crunch Collected Data

           =>

  2 possible approaches

- Decoupled R and Python
- Integrated Approach RPy Option
Decouple R and Python

Python retrieves data from django/postgresql
Python converts data shapefiles, images etc
Launches R given a *.r file with Scientist’s parameters
R does the analysis
Python does post-processing, projecting data etc
Integrated R & Python with RPy

 R and Python closely coupled
 RPy and RPy2 provides an interface to R Programming Language
 Python retrieves and organizes parameters from django/postgresql
 RPy module imported and R commands are executed within the
Python script file
Getting a GPS fix via Satellite?
Mathematical Modelling, Scenario Analysis
      for Environmental Policies
REDDCalculator.com (Live)         SEC (Closed Beta)




                                                          LUC
                                                      (Coming Soon!)




                                                !



          ENVIRONMENTAL iTOOLS
 Spatially Explicit Scenario Analysis: Norway-Indonesia’s Forest Moratorium
 Species Extinction Calculator (SEC)
 Land Use Calculator (LUC)
Species Extinction Calculator and REDDCalculator:

Mathematical Models and Formulas by Koh et. al are completely
translated into Python

Land Use Calculator:

Ditto. Coming Soon!
Key Takeaways
Mapnik is useful for rasterizing vector objects when we encounter large
datasets (in our case, 200 MB+ of protected areas in Kalimantan).

(jQuery Mobile) Web App can benefit from optimization through django
caching. To be done right after EuroPython! And besides jQuery Mobile
Beta 1 has just been released on Monday (20 June 2011)! :-)

Usability and App Responsiveness can possibly be improved, Out-Field/
Offline Benefits attainable, if we move interface elements and Map Tiles
into a native app (Android or iOS).
geography=True/False in a GeoDjango field

2 ways to import data from a given GIS Shape File

(1) LayerMapping

(2) Direct Assignment to obj.geom attribute as mentioned.
“ Advancing Environmental Sciences:

 helping people, scientists, NGOs and governments make
 practical Land Area Usage and Conservation Decisions
 using jQuery (Mobile), OpenLayers and GeoDjango! ”
Gotchas?
Make sure Projections/Datum in your shape file source corresponds
with your geometry field’s SRID and Map Source

Using LayerMapping?

transform = True

Directly creating or saving into an object’s attribute?

geometry_object = feature.geom.transform(SpatialReference(4326),
clone=True).geos
area.geom = geometry_object
area.save()
3
Why It Rocks
MVC structure

Great community and reusable django apps (“modules”)

Organize code in apps (“modules”)

Coupled but replaceable user interface for device specific implementations

Rich, powerful functionality from open source software and libraries

Focus on people, skills, collaboration and creativity
Credits
+ North-South Fund




Prof. Koh Lian Pin                 Prof. Matthew Hansen             Prof. Holly Gibbs
ETH Zurich, Dept of Env Sciences   South Dakota State University    Stanford Dept of Environmental
NUS, Dept of Biological Sciences   GIS Center of Excellence         Earth System Sciences
Previous GeoDjango Presentations + my little contribution

   www.geodjango.org/presentations

   www.od-eon.com/presentations
Questions and Discussion welcome!

    calvin.cheng@od-eon.com

Weitere ähnliche Inhalte

Was ist angesagt?

Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScriptniklal
 
Data Munging in R - Chicago R User Group
Data Munging in R - Chicago R User GroupData Munging in R - Chicago R User Group
Data Munging in R - Chicago R User Groupdesignandanalytics
 
Javasccript MV* frameworks
Javasccript MV* frameworksJavasccript MV* frameworks
Javasccript MV* frameworksKerry Buckley
 
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 AutumnGoptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 AutumnMasashi Shibata
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserHoward Lewis Ship
 
The Ring programming language version 1.8 book - Part 65 of 202
The Ring programming language version 1.8 book - Part 65 of 202The Ring programming language version 1.8 book - Part 65 of 202
The Ring programming language version 1.8 book - Part 65 of 202Mahmoud Samir Fayed
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeMongoDB
 
究極のコントローラを目指す
究極のコントローラを目指す究極のコントローラを目指す
究極のコントローラを目指すYasuo Harada
 
Jquery 1.3 cheatsheet_v1
Jquery 1.3 cheatsheet_v1Jquery 1.3 cheatsheet_v1
Jquery 1.3 cheatsheet_v1Sultan Khan
 
Jquery 13 cheatsheet_v1
Jquery 13 cheatsheet_v1Jquery 13 cheatsheet_v1
Jquery 13 cheatsheet_v1ilesh raval
 
Recent Changes to jQuery's Internals
Recent Changes to jQuery's InternalsRecent Changes to jQuery's Internals
Recent Changes to jQuery's Internalsjeresig
 
Writing Clean Code in Swift
Writing Clean Code in SwiftWriting Clean Code in Swift
Writing Clean Code in SwiftDerek Lee Boire
 
DroidKnight 2018 State machine by Selaed class
DroidKnight 2018 State machine by Selaed classDroidKnight 2018 State machine by Selaed class
DroidKnight 2018 State machine by Selaed classMyeongin Woo
 
Javascript essential-pattern
Javascript essential-patternJavascript essential-pattern
Javascript essential-pattern偉格 高
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Remy Sharp
 
jQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20PresentationjQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20Presentationguestcf600a
 

Was ist angesagt? (20)

Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 
Data Munging in R - Chicago R User Group
Data Munging in R - Chicago R User GroupData Munging in R - Chicago R User Group
Data Munging in R - Chicago R User Group
 
Javasccript MV* frameworks
Javasccript MV* frameworksJavasccript MV* frameworks
Javasccript MV* frameworks
 
Rug hogan-10-03-2012
Rug hogan-10-03-2012Rug hogan-10-03-2012
Rug hogan-10-03-2012
 
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 AutumnGoptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The Browser
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
The Ring programming language version 1.8 book - Part 65 of 202
The Ring programming language version 1.8 book - Part 65 of 202The Ring programming language version 1.8 book - Part 65 of 202
The Ring programming language version 1.8 book - Part 65 of 202
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
究極のコントローラを目指す
究極のコントローラを目指す究極のコントローラを目指す
究極のコントローラを目指す
 
Jquery 1.3 cheatsheet_v1
Jquery 1.3 cheatsheet_v1Jquery 1.3 cheatsheet_v1
Jquery 1.3 cheatsheet_v1
 
Jquery 13 cheatsheet_v1
Jquery 13 cheatsheet_v1Jquery 13 cheatsheet_v1
Jquery 13 cheatsheet_v1
 
Recent Changes to jQuery's Internals
Recent Changes to jQuery's InternalsRecent Changes to jQuery's Internals
Recent Changes to jQuery's Internals
 
Writing Clean Code in Swift
Writing Clean Code in SwiftWriting Clean Code in Swift
Writing Clean Code in Swift
 
DroidKnight 2018 State machine by Selaed class
DroidKnight 2018 State machine by Selaed classDroidKnight 2018 State machine by Selaed class
DroidKnight 2018 State machine by Selaed class
 
Javascript essential-pattern
Javascript essential-patternJavascript essential-pattern
Javascript essential-pattern
 
this
thisthis
this
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
 
jQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20PresentationjQuery%20on%20Rails%20Presentation
jQuery%20on%20Rails%20Presentation
 

Andere mochten auch

Andere mochten auch (20)

Bing Maps Snapshot
Bing Maps SnapshotBing Maps Snapshot
Bing Maps Snapshot
 
PyDX Presentation about Python, GeoData and Maps
PyDX Presentation about Python, GeoData and MapsPyDX Presentation about Python, GeoData and Maps
PyDX Presentation about Python, GeoData and Maps
 
Me&U - Atkins Official Newsletter
Me&U - Atkins Official NewsletterMe&U - Atkins Official Newsletter
Me&U - Atkins Official Newsletter
 
Cambodia
Cambodia Cambodia
Cambodia
 
HDF Status and Development
HDF Status and DevelopmentHDF Status and Development
HDF Status and Development
 
As Biologists
As BiologistsAs Biologists
As Biologists
 
Question 2
Question 2Question 2
Question 2
 
AtlasCopco_Partner_No_2
AtlasCopco_Partner_No_2AtlasCopco_Partner_No_2
AtlasCopco_Partner_No_2
 
Digital news report 2016 Reuters
Digital news report 2016 ReutersDigital news report 2016 Reuters
Digital news report 2016 Reuters
 
S2C Wave 3 Ambassadorial Journey
S2C Wave 3 Ambassadorial JourneyS2C Wave 3 Ambassadorial Journey
S2C Wave 3 Ambassadorial Journey
 
The M-Jirga
The M-JirgaThe M-Jirga
The M-Jirga
 
Libro de calculo 3
Libro de calculo 3Libro de calculo 3
Libro de calculo 3
 
Mercator Ocean newsletter 30
Mercator Ocean newsletter 30Mercator Ocean newsletter 30
Mercator Ocean newsletter 30
 
[Android] Multimedia Programming
[Android] Multimedia Programming[Android] Multimedia Programming
[Android] Multimedia Programming
 
FINAL_Report
FINAL_ReportFINAL_Report
FINAL_Report
 
Geo study
Geo study Geo study
Geo study
 
Kyrgyzstan
KyrgyzstanKyrgyzstan
Kyrgyzstan
 
Vinmonopolet - Norges beste omdømme
Vinmonopolet - Norges beste omdømmeVinmonopolet - Norges beste omdømme
Vinmonopolet - Norges beste omdømme
 
AMPA2
AMPA2AMPA2
AMPA2
 
PAR for Doctors EIS
PAR for Doctors EISPAR for Doctors EIS
PAR for Doctors EIS
 

Ähnlich wie Django101 geodjango

Saving Gaia with GeoDjango
Saving Gaia with GeoDjangoSaving Gaia with GeoDjango
Saving Gaia with GeoDjangoCalvin Cheng
 
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011Rafael Soto
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By DesignAll Things Open
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locatorAlberto Paro
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locatorAlberto Paro
 
GeoDjango & HTML5 Geolocation
GeoDjango & HTML5 GeolocationGeoDjango & HTML5 Geolocation
GeoDjango & HTML5 GeolocationJohn Paulett
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...Functional Thursday
 
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜Takahiro Inoue
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Introduction aux Macros
Introduction aux MacrosIntroduction aux Macros
Introduction aux Macrosunivalence
 
Tips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software EngineeringTips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software Engineeringjtdudley
 
Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...
Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...
Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...Matthew J Collins
 
Strategies to foster OER and OER initiatives in developing regions
Strategies to foster OER and OER initiatives in developing regionsStrategies to foster OER and OER initiatives in developing regions
Strategies to foster OER and OER initiatives in developing regions@cristobalcobo
 
Eventsourcing with PHP and MongoDB
Eventsourcing with PHP and MongoDBEventsourcing with PHP and MongoDB
Eventsourcing with PHP and MongoDBJacopo Nardiello
 
Object.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examplesObject.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examplesRobert Lujo
 

Ähnlich wie Django101 geodjango (20)

Saving Gaia with GeoDjango
Saving Gaia with GeoDjangoSaving Gaia with GeoDjango
Saving Gaia with GeoDjango
 
Trimming The Cruft
Trimming The CruftTrimming The Cruft
Trimming The Cruft
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By Design
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
 
GeoDjango & HTML5 Geolocation
GeoDjango & HTML5 GeolocationGeoDjango & HTML5 Geolocation
GeoDjango & HTML5 Geolocation
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...
 
Learning How To Use Jquery #3
Learning How To Use Jquery #3Learning How To Use Jquery #3
Learning How To Use Jquery #3
 
jQuery Loves You
jQuery Loves YoujQuery Loves You
jQuery Loves You
 
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Introduction aux Macros
Introduction aux MacrosIntroduction aux Macros
Introduction aux Macros
 
Tips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software EngineeringTips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software Engineering
 
Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...
Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...
Mining Whole Museum Collections Datasets for Expanding Understanding of Colle...
 
Strategies to foster OER and OER initiatives in developing regions
Strategies to foster OER and OER initiatives in developing regionsStrategies to foster OER and OER initiatives in developing regions
Strategies to foster OER and OER initiatives in developing regions
 
Eventsourcing with PHP and MongoDB
Eventsourcing with PHP and MongoDBEventsourcing with PHP and MongoDB
Eventsourcing with PHP and MongoDB
 
Object.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examplesObject.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examples
 

Mehr von Calvin Cheng

FOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/Sovrin
FOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/SovrinFOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/Sovrin
FOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/SovrinCalvin Cheng
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Calvin Cheng
 
Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)Calvin Cheng
 
iOS Beginners Lesson 4
iOS Beginners Lesson 4iOS Beginners Lesson 4
iOS Beginners Lesson 4Calvin Cheng
 
iOS Beginners Lesson 3
iOS Beginners Lesson 3iOS Beginners Lesson 3
iOS Beginners Lesson 3Calvin Cheng
 
iOS Beginners Lesson 2
iOS Beginners Lesson 2iOS Beginners Lesson 2
iOS Beginners Lesson 2Calvin Cheng
 
iOS Beginners Lesson 1
iOS Beginners Lesson 1iOS Beginners Lesson 1
iOS Beginners Lesson 1Calvin Cheng
 
So, you want to build a Bluetooth Low Energy device?
So, you want to build a Bluetooth Low Energy device?So, you want to build a Bluetooth Low Energy device?
So, you want to build a Bluetooth Low Energy device?Calvin Cheng
 
Learning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksLearning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksCalvin Cheng
 
Agile Apps with App Engine
Agile Apps with App EngineAgile Apps with App Engine
Agile Apps with App EngineCalvin Cheng
 

Mehr von Calvin Cheng (14)

FOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/Sovrin
FOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/SovrinFOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/Sovrin
FOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/Sovrin
 
Hashgraph as Code
Hashgraph as CodeHashgraph as Code
Hashgraph as Code
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)
 
Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)
 
iOS Beginners Lesson 4
iOS Beginners Lesson 4iOS Beginners Lesson 4
iOS Beginners Lesson 4
 
iOS Beginners Lesson 3
iOS Beginners Lesson 3iOS Beginners Lesson 3
iOS Beginners Lesson 3
 
iOS Beginners Lesson 2
iOS Beginners Lesson 2iOS Beginners Lesson 2
iOS Beginners Lesson 2
 
iOS Beginners Lesson 1
iOS Beginners Lesson 1iOS Beginners Lesson 1
iOS Beginners Lesson 1
 
So, you want to build a Bluetooth Low Energy device?
So, you want to build a Bluetooth Low Energy device?So, you want to build a Bluetooth Low Energy device?
So, you want to build a Bluetooth Low Energy device?
 
Fabric
FabricFabric
Fabric
 
Learning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksLearning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeks
 
Ladypy 01
Ladypy 01Ladypy 01
Ladypy 01
 
zhng your vim
zhng your vimzhng your vim
zhng your vim
 
Agile Apps with App Engine
Agile Apps with App EngineAgile Apps with App Engine
Agile Apps with App Engine
 

Kürzlich hochgeladen

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 

Django101 geodjango

  • 1. DJANGO 101 + GEODJANGO why it rocks
  • 2. CALVIN CHENG www.calvinx.com www.od-eon.com/blogs/calvin
  • 3. Stefan Talpalaru Liviu Bogdan Chiributa That’s Me! :-) Odeon Consulting Group Odeon Consulting Group Odeon Consulting Group + ........
  • 4. 1 Django Basics 2 GeoDjango 3 Why It Rocks
  • 6. HTTP request (POST, GET) HTTP response urls.py (1) (url definitions) views.py (5) *.html (“controller”) (HTML template) (4) (2) (3) models.py DB agnostic ORM Actual Database
  • 8.
  • 9.
  • 10.
  • 11. Shared Hosting: Webfaction VPS: Linode VPS: Slicehost Cloud: Amazon EC2
  • 12.
  • 14. REDDCalculator.com (Beta) SEC (Closed Beta) LUC (Coming Soon!) ! ENVIRONMENTAL iTOOLS Spatially Explicit Scenario Analysis: Norway-Indonesia’s Forest Moratorium Species Extinction Calculator (SEC) Land Use Calculator (LUC)
  • 15.
  • 17. 4% 4" &'#()#*% 123# !"#$$%&'()*"+,-./0" !"#$%
  • 18. 3,000 2,250 Number of species 1,500 750 0 100 200 300 400 500 600 700 800 Area conserved (km sq) SPECIES-AREA More habitats conserved (Area) = More fauna diversity (Species)
  • 19.
  • 20. +) !) ) &,- ! ) * "#$%$&'( ( ) . &,- . ) "#$%$&'( )
  • 21. !"#$%&'()3+(451"67(&/&012( !"#$%&'()*+(,-.&(&/&012(
  • 22. 0$1,23+4")56)'."+4,2+"+'*,'7$2/+)$4"'8$*.51' !"#$%&"'"(")*+',-'-,."+*'"/#"+' N # $ % "i $ ! i i =1 ! - M ( ) #% "!$ j ) ) ) * &+, &+, j =1 ! - ) ) "#$%$&'( "#$%$&'(
  • 23. MATRIX-CALIBRATED SPECIES-AREA Accounts for taxon-specific responses to different components of the landscape
  • 24. EXAMPLE OF AN AREA? Conservation Forests, National Reserves etc Borneo 743,330 square kilometres
  • 25. USERS AND USE-CASE Conservation scientists and Land owners define areas which are conserved by plotting polygons on a map source (e.g. Google Maps). Areas which are slated for development are also marked. By quantifying area conservation goals (areas conserved before and after development) and its impact on the loss of species, SEC is a tool which helps people make better trade-off decisions.
  • 26. USERS AND USE-CASE REDDCalculator.com computes the socio-economic trade-offs and results as a consequence of the Norway-Indonesia REDD+ Moratorium.
  • 27.
  • 28. Layers & Features (‘Vector Objects’) jQuery & OpenLayers User Interface Map Source KML GML WKT GeoJSON GeoRSS Others Data (serialized) GeoDjango Python Logic C/C++ Libraries w/ Python Bindings & Datastore
  • 29. (2.7)
  • 31. sudo -u postgres psql -d yourdatabase_name -f { ... }/postgis.sql sudo -u postgres psql -d yourdatabase_name -f { ... }/postgis_comments.sql sudo -u postgres psql -d yourdatabase_name -f { ... }/spatial_ref_sys.sql
  • 32. sudo -u postgres psql -d yourdatabase_name -f /opt/local/var/macports/ software/postgis/1.5.2_1+postgresql90/opt/local/share/postgresql90/ contrib/postgis-1.5/postgis.sql sudo -u postgres psql -d yourdatabase_name -f /opt/local/var/macports/ software/postgis/1.5.2_1+postgresql90/opt/local/share/postgresql90/ contrib/postgis-1.5/postgis_comments.sql sudo -u postgres psql -d yourdatabase_name -f /opt/local/var/macports/ software/postgis/1.5.2_1+postgresql90/opt/local/share/postgresql90/ contrib/postgis-1.5/spatial_ref_sys.sql
  • 33. Portage exists But here’s a magical way - https://github.com/stefantalpalaru/dotfiles/ tree/master/Gentoo/custom%20overlay/portage/dev-db/postgis - custom postgis ebuild modified by Stefan add ebuild to local ‘overlay’ (a gentoo terminology) emerge postgis edit configuration file in /etc/conf.d/postgis and add in the postgresql database that you need ‘postgis-enabled’ emerge --config postgis
  • 34. # settings.py INSTALLED_APPS = ( # Core Django Apps 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.flatpages', 'django.contrib.humanize', 'django.contrib.comments', 'django.contrib.markup', 'django.contrib.webdesign', 'django.contrib.sitemaps', 'django.contrib.gis', # Custom Apps for REDDCalculator.com 'updatemodel', 'location', 'areadata', # Generic and reusable apps for most projects 'south', 'django_cherrypy_odeon', 'misc', 'cron', 'notify', 'log', 'homepage', 'userprofile', )
  • 35. # settings.py DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', ‘NAME’: ‘yourdatabase_name’, 'USER': 'yourdatabase_user’, 'PASSWORD': 'yourdatabase_password', 'HOST': 'your_ip_or_domain', } }
  • 38. from django.contrib.gis.db import models class Province(models.Model): name = models.CharField(max_length=256) name_long = models.CharField(max_length=256, null=True) island = models.ForeignKey(Location, null=True) geom = models.MultiPolygonField(srid=4326, null=True) objects = models.GeoManager()
  • 39. from django.contrib.gis.db import models class Province(models.Model): name = models.CharField(max_length=256) name_long = models.CharField(max_length=256, null=True) island = models.ForeignKey(Location, null=True) geom = models.MultiPolygonField(srid=4326, null=True, geography=True) objects = models.GeoManager()
  • 40. What are the geometry fields available to us in django?
  • 41. GEOS: OGC simple feature implementation PointField MultiPointField LineStringField MultiLineStringField PolygonField MultiPolygonField GeometryCollectionField
  • 42. PointField (x, y)
  • 44. LineStringField ((x1, y1), (x2, y2), (x3, y3), (x4, y4))
  • 45. MultiLineStringField (((x1, y1), (x2, y2), (x3, y3), (x4, y4)),((x5, y5), (x6, y6)))
  • 46. PolygonField ((x1, y1), (x2, y2), (x3, y3), (x4, y4), (x1, y1))
  • 47. MultiPolygonField ((x1, y1), (x2, y2), (x3, y3), (x4, y4), (x1, y1)), ((x5, y5), (x6, y6), (x7, y7), (x5, y5)))
  • 48. GeometryCollectionField ((x1, y1), (x2, y2), (x3, y3), (x4, y4), (x1, y1)), ((x5, y5), (x6, y6), (x7, y7)), ((x8, y8)))
  • 49. Practical Example #1: Species Extinction Calculator
  • 50. Practical Example #2: REDDCalculator.com
  • 51. from django.contrib.gis.gdal import datasource, spatialreference from django.contrib.gis.geos import multipolygon, geosgeometry shapefile = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../proj_public/media/files/giveshapefile.shp')) ds = DataSource(shapefile) layer = ds[0] # Checked in Python shell that this has only 1 layer
  • 52. from django.contrib.gis.db import models class AreaData(models.Model): district = models.ForeignKey(District) # District is FKed to Province land_use = models.IntegerField(choices=VEGETATION_TYPES) allocation = models.IntegerField(choices= CHOICES['LAND_ALLOCATION']) intact = models.IntegerField() concession = models.CharField(max_length=255, blank=True) peat = models.CharField(max_length=255, blank=True) area = models.FloatField(help_text='hectares') fid = models.IntegerField() # ... and any other. geom = models.MultiPolygonField(srid=4326, null=True) objects = models.GeoManager()
  • 53. area = AreaData.objects.get(fid = feature.fid) geometry_name = feature.geom.geom_type.name geometry_object = feature.geom.transform(SpatialReference(4326), clone=True).geos # update our area object with the geom data from our shape file if geometry_name == 'Polygon': # If our geometry object is a Polygon, we cast as MultiPolygon first geometry_object = MultiPolygon(geometry_object) area.geom = geometry_object area.save()
  • 55. GEOS GDAL PROJ.4 Mapnik GeoIP
  • 57. LayerMapping ./manage.py ogrinspect ./manage.py ogrinfo
  • 58. ./manage.py ogrinspect and LayerMapping
  • 59. $ ./manage.py ogrinspect ../proj_public/media/files/redd_data/ kalimantan_universe.shp Location --srid=4326 --mapping # This is an auto-generated Django model module created by ogrinspect. from django.contrib.gis.db import models class Location(models.Model): island = models.CharField(max_length=50) geom = models.MultiPolygonField(srid=4326) objects = models.GeoManager() # Auto-generated `LayerMapping` dictionary for Location model location_mapping = { 'island' : 'island', 'geom' : 'MULTIPOLYGON', }
  • 60. # models.py from django.contrib.gis.db import models class Location(models.Model): island = models.CharField(max_length=50) geom = models.MultiPolygonField(srid=4326) objects = models.GeoManager() # Auto-generated `LayerMapping` dictionary for Kalimantan model location_mapping = { 'island' : 'island', 'geom' : 'MULTIPOLYGON', }
  • 61. import os from django.contrib.gis.utils import LayerMapping from django.contrib.gis.gdal import DataSource from location.models import Location, location_mapping shapefile = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../proj_public/media/files/kalimantan_universe.shp')) ds = DataSource(shapefile) layer = ds[0] # Checked in Python shell that this has only 1 layer kalimantan = LayerMapping(Location, shapefile, location_mapping, transform = True, encoding='iso-8859-1') kalimantan.save(strict = True, verbose = True)
  • 62. Get your Polygon showing up for Free! GeoAdmin FTW
  • 63. from django.contrib.gis import admin as geoadmin from location.models import Location admin.site.register(Location, geoadmin.GeoModelAdmin)
  • 64.
  • 66. “ OpenLayers is a pure JavaScript library for displaying map data in most modern web browsers, with no server-side dependencies. ”
  • 68. “ jQuery Mobile is a Touch-Optimized Web Framework for Smartphones and Tablets. ”
  • 69. + +
  • 70. $(document).ready(function(){ $('#map_delete').hide() // Define a custom styles which will be used by our polygon layer var style = $.extend(true, {}, OpenLayers.Feature.Vector.style['default']) // get a copy of default style style.pointRadius = 15 var styleMap = new OpenLayers.StyleMap({"default": style}) // Define a custom style which will be used by our background layer var backgroundStyle = $.extend(true, {}, OpenLayers.Feature.Vector.style['default']) // get copy backgroundStyle.fillOpacity = "0.1" backgroundStyle.fillColor = "#000000" backgroundStyle.strokeColor = "#999999" var backgroundStyleMap = new OpenLayers.StyleMap({"default": backgroundStyle}) // Define our background layer backgroundLayer = new OpenLayers.Layer.Vector("Background Layer", {styleMap: backgroundStyleMap} )
  • 71. // Define our vector layer polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer", {styleMap: styleMap}) polygonLayer.events.on({ 'featureselected': show_delete_button, 'featureunselected': hide_delete_button }) // Define our toolbar, panels and associated controls // pinch and zoom is defined in touch navigation var touchNavigation = new OpenLayers.Control.TouchNavigation({ dragPanOptions: { interval: 100, enableKinetic: true } }) // define our zoom panel var zoomPanel = new OpenLayers.Control.ZoomPanel() // define our layer switcher var layerSwitcher = new OpenLayers.Control.LayerSwitcher()
  • 72. // controls drawControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.Polygon, { displayClass: 'olControlDrawFeaturePolygon'}); selectControl = new OpenLayers.Control.SelectFeature(polygonLayer, { clickout: true }); editControl = new OpenLayers.Control.ModifyFeature(polygonLayer, { selectControl: selectControl, vertexRenderIntent: 'temporary', displayClass: 'olControlModifyFeature'}); // define our custom control tool bar var toolbar = new OpenLayers.Control.Panel({displayClass: 'olControlEditingToolbar'}); toolbar.addControls([ //this control is just there to be able to deactivate the drawing tools and pan the map drawControl, editControl, new OpenLayers.Control({ displayClass: 'olControlNavigation' }) ]);
  • 73. // Define Map Layers var gphy = new OpenLayers.Layer.Google("Google Physical", {type: google.maps.MapTypeId.TERRAIN}); var gmap = new OpenLayers.Layer.Google("Google Streets", {numZoomLevels: 20}); var ghyb = new OpenLayers.Layer.Google("Google Hybrid", {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}); var gsat = new OpenLayers.Layer.Google("Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 20}); // Feed the controls and layers defined above to our map object map = new OpenLayers.Map({ div: 'map', controls: [zoomPanel, touchNavigation, layerSwitcher, toolbar], layers: [ghyb, gphy, gmap, gsat, backgroundLayer, polygonLayer] })
  • 74.
  • 75. // Google.v3 uses EPSG:900913 as projection, so we have to transform our coordinates mapProjection = map.getProjectionObject() map.setCenter(new OpenLayers.LonLat(map_center_lon, map_center_lat).transform(defaultProjection, mapProjection), map_zoom) // if there's a Total Landscape Area polygon, we will draw it on the backgroundLayer. if (background_coords_json){ var pointList = [] for (var i=0; i<background_coords_json.length; i++) { var point = new OpenLayers.Geometry.Point(background_coords_json[i][0], background_coords_json[i] [1]) pointList.push(point.transform(defaultProjection, mapProjection)); } var linearRing = new OpenLayers.Geometry.LinearRing(pointList) totalAreaPolygon = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing])) backgroundLayer.addFeatures([totalAreaPolygon]) }
  • 76. // draw the existing features into the polygonLayer var loaded_features = [] for (var i=0; i<list_of_coords_json.length; i++) { var pointList = [] for (var j=0; j<list_of_coords_json[i].length; j++) { var point = new OpenLayers.Geometry.Point(list_of_coords_json[i][j][0], list_of_coords_json[i][j][1]) pointList.push(point.transform(defaultProjection, mapProjection)); } var linearRing = new OpenLayers.Geometry.LinearRing(pointList) var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]), {fid: list_of_coords_ids_json[i]}) loaded_features.push(polygonFeature) } polygonLayer.addFeatures(loaded_features) polygonLayer.events.on({ "featuremodified": polygonSave, "featureadded": polygonSave, "vertexmodified": adjustVertex, "sketchstarted": adjustVertex, "sketchmodified": adjustVertex }) // confirmation dialog $('#project_map_delete_polygon_yes').click(delete_polygon) }) /* END of $(document).ready() */
  • 78. 1. Offline Maps for Field Usage 2. Remote Controlled UAV for data collection 3. Crunch collected data and generate visualizations
  • 79. Offline Maps for Field Usage
  • 80. Layers & Features (Saved Locally, Syncing) Native iOS/Android Native? Map Source (Local Map Tiles) KML GML WKT GeoJSON GeoRSS Others Data Transfer GeoDjango Python Logic C/C++ Libraries w/ Python Bindings & Datastore
  • 81. The Problem with iOS MapKit Framework MKMapView class implements Google Maps API natively Unfortunately, Google Maps terms of use prevents us from caching or storing map tiles locally
  • 82. Alternative? https://github.com/route-me/route-me Supports many map sources - OpenStreetMap, Microsoft VirtualEarth, CloudMade, OpenAerialMap, OpenCycleMap, SpatialCloud OpenStreetMap permits map tile caching and local storage Supports 2 offline, database-backed formats DBMap and MBTiles
  • 83. A Comparison MKMapKit Route-Me Embed in iOS App YES YES Interaction YES YES Geolocalization YES YES Different Map Sources NO YES Offline Maps NO YES
  • 84. The Problem with Android Google Maps Framework Renders Google Maps of course Support for alternative map sources is important
  • 85. Alternative? https://github.com/camptocamp/android-gis.git Supports many map sources - OpenStreetMap, Microsoft VirtualEarth, CloudMade, OpenAerialMap, OpenCycleMap, SpatialCloud OpenStreetMap permits map tile caching and local storage Supports 2 offline, database-backed formats DBMap and MBTiles
  • 86. Benefits Fast (obviously, since Map Tiles are stored locally) 100% Offline Stored as blob data for SQLite Client Access
  • 88. Collect Real Data => Effects on Landscape Change on Species e.g. obtain actual change in Forest Boundaries (instead of just predicting on map on current prediction tool)
  • 89. Prediction is great. But we want real world data from primary forests!
  • 90.
  • 91.
  • 92.
  • 94. Crunch Collected Data => 2 possible approaches - Decoupled R and Python - Integrated Approach RPy Option
  • 95. Decouple R and Python Python retrieves data from django/postgresql Python converts data shapefiles, images etc Launches R given a *.r file with Scientist’s parameters R does the analysis Python does post-processing, projecting data etc
  • 96. Integrated R & Python with RPy R and Python closely coupled RPy and RPy2 provides an interface to R Programming Language Python retrieves and organizes parameters from django/postgresql RPy module imported and R commands are executed within the Python script file
  • 97. Getting a GPS fix via Satellite?
  • 98. Mathematical Modelling, Scenario Analysis for Environmental Policies
  • 99.
  • 100. REDDCalculator.com (Live) SEC (Closed Beta) LUC (Coming Soon!) ! ENVIRONMENTAL iTOOLS Spatially Explicit Scenario Analysis: Norway-Indonesia’s Forest Moratorium Species Extinction Calculator (SEC) Land Use Calculator (LUC)
  • 101. Species Extinction Calculator and REDDCalculator: Mathematical Models and Formulas by Koh et. al are completely translated into Python Land Use Calculator: Ditto. Coming Soon!
  • 103. Mapnik is useful for rasterizing vector objects when we encounter large datasets (in our case, 200 MB+ of protected areas in Kalimantan). (jQuery Mobile) Web App can benefit from optimization through django caching. To be done right after EuroPython! And besides jQuery Mobile Beta 1 has just been released on Monday (20 June 2011)! :-) Usability and App Responsiveness can possibly be improved, Out-Field/ Offline Benefits attainable, if we move interface elements and Map Tiles into a native app (Android or iOS).
  • 104. geography=True/False in a GeoDjango field 2 ways to import data from a given GIS Shape File (1) LayerMapping (2) Direct Assignment to obj.geom attribute as mentioned.
  • 105. “ Advancing Environmental Sciences: helping people, scientists, NGOs and governments make practical Land Area Usage and Conservation Decisions using jQuery (Mobile), OpenLayers and GeoDjango! ”
  • 107. Make sure Projections/Datum in your shape file source corresponds with your geometry field’s SRID and Map Source Using LayerMapping? transform = True Directly creating or saving into an object’s attribute? geometry_object = feature.geom.transform(SpatialReference(4326), clone=True).geos area.geom = geometry_object area.save()
  • 109. MVC structure Great community and reusable django apps (“modules”) Organize code in apps (“modules”) Coupled but replaceable user interface for device specific implementations Rich, powerful functionality from open source software and libraries Focus on people, skills, collaboration and creativity
  • 111. + North-South Fund Prof. Koh Lian Pin Prof. Matthew Hansen Prof. Holly Gibbs ETH Zurich, Dept of Env Sciences South Dakota State University Stanford Dept of Environmental NUS, Dept of Biological Sciences GIS Center of Excellence Earth System Sciences
  • 112. Previous GeoDjango Presentations + my little contribution www.geodjango.org/presentations www.od-eon.com/presentations
  • 113. Questions and Discussion welcome! calvin.cheng@od-eon.com

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. * Today, I will be talking about the context in which jQuery Mobile, OpenLayers and GeoDjango are applied to help scientists, NGOs and governments make practical land use and conservation decisions.\n* I will illustrate the technology stack that we have used and talk briefly about the installation process for various GeoDjango dependencies on Mac OS X and Gentoo. \n* We usually use Gentoo on our servers. Yes I know, it&amp;#x2019;s nuts but that&amp;#x2019;s what Stefan, my colleague and CTO in Odeon, is proficient with, with over 11 years of experience.\n* My weapon of choice for my interface design and python work is my Macbook.\n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n\n
  15. \n
  16. \n
  17. * So, this is where it begins. Species extinction in the old days have been simply correlated to Area loss using the Arrhenius equation.\n\n
  18. * Here&amp;#x2019;s a graphical representation of the Arrhenius formula.\n* But of course, this is an outdated model and is wildly inaccurate.\n
  19. * Modern conservation biologists and environmental scientists needed a more accurate prediction model\n* And they realise that land-use change on a mainland often creates landscapes that kind of look like islands of forests in an ocean of other land uses\n\n
  20. * So this is what modern environmental scientists adopted as a working model.\n* The species-area model is often used by conservation biologists to predict biodiversity loss based upon forest loss\n* S(new) refers to species after an area of interest (also referred to as the &amp;#x201C;Total Landscape Area&amp;#x201D;) has been modified by human activity.\n* S(original) refers to the original number of species residing in the area.\n* Ditto for A\n* Z is an arbitrary number which varies according to various other conditions\n
  21. However, there are 2 problems with this approach...\n#1: it assumes that the landscape matrix, the land uses in-between forest fragments, are completely inhospitable to any species, which obviously is not always true\n#2: it assumes that species are not affected by edge effects: deleterious effects on a forest fragment mediated by biophysical interactions near the interface between forest and matrix\nAlthough ecologists know that these assumptions are unrealistic, the species-area model continues to be used in assessments of biodiversity loss and in conservation planning. That was what motivated Koh et. al to develop a better tool \n\n
  22. * Koh et al&amp;#x2019;s improved model addresses those shortcomings by accounting for how species respond to changes in composition &amp; quality of the matrix, and it also accounts for effects of forest edges\n* These improvements allow for predictions of extinction risks that are specific to the landscape and the taxon of interest\n* Result? An improved accuracy in predicting how land use changes affect species diversity\n* This new model of predicting species response to land use changes has been accepted in Conservation Biology and Journal of Applied Ecology.\n\n
  23. * This gives us a beautiful 3 dimensional graph as above.\n* So how does all these formulas relate to what we do with a GIS (Geographical Information System) application using GeoDjango?\n
  24. * Area, of course. Calculating and defining the area is core to producing a reasonably accurate prediction estimate for policy making by governments, NGOs and the united nation.\n* 3rd largest island in the world. (after greenland and new guinea). Ref: http://en.wikipedia.org/wiki/List_of_islands_by_area\n*The island is divided among three countries: Brunei, Indonesia and Malaysia. Approximately 73% of the island is Indonesian territory. The Malaysian states of Sabah and Sarawak in the north occupy about 26% of the island. The sovereign state of Brunei, located on the north coast, comprises about 1% of Borneo&apos;s land area. It has the oldest rainforest in the world ahead of the Amazon rainforest inBrazil.\n
  25. * 3rd largest island in the world. (after greenland and new guinea). Ref: http://en.wikipedia.org/wiki/List_of_islands_by_area\n* Specifically Kalimantan\n\n
  26. * Loss of species, carbon emissions as a balance against employment and financial losses\n\n
  27. * Here&amp;#x2019;s an example screen shot of polygons plotted by land owners in collaboration with environmental scientists.\n* We will go into the code details and what each of these polygons in a while.\n* But first, for those not familiar with terminologies and the basic concepts of Geographical Information Systems (GIS) software, I will provide a simple overview of the technology stack and associated libraries which you will need to install before getting started.\n
  28. * The user interface\n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. * &amp;#x201C;from django.db import models&amp;#x201D; is, of course, the usual way we import the django models class before writing our custom models.\n* For our model to contain GIS capabilities, like storing a geographical feature as an attribute, we will simply subclass from django.contrib.gis.db instead.\n\n
  38. * add the geometry field you need. in this example, &amp;#x201C;geom&amp;#x201D; is our geometry field and it is a contains a MultiPolygon object using the datum WGS84 (i.e. 4326)\n* \n\n
  39. * an interesting note about the geography attribute in a GeoDjango Field\n* polygons computed are assumed to be based on its 2D area.\n* by stating geography=True, areas computed will based on the ellipsoidal surface area, which gives a more accurate result at the expense of slightly poorer performance\n* in other words, you need to take a design decision on this trade-off.\n
  40. * &amp;#x201C;from django.db import models&amp;#x201D; is, of course, the usual way we import the django models class before writing our custom models.\n* For our model to contain GIS capabilities, like storing a geographical feature as an attribute, we will simply subclass from django.contrib.gis.db instead.\n\n
  41. \n\n
  42. * represented by coordinates, specific to the projection or datum\n\n
  43. * represented by coordinates, specific to the projection or datum\n\n
  44. * represented by coordinates, specific to the projection or datum\n\n
  45. * represented by coordinates, specific to the projection or datum\n\n
  46. * represented by coordinates, specific to the projection or datum\n\n
  47. * obviously :-) more than 1 or more Polygons stored in this field!\n\n
  48. * A collection of different geometries can be stored in the field\n\n
  49. * Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
  50. \n\n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n\n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. * Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. * Here, you can visualize what I just explained.\n
  75. \n
  76. \n
  77. \n
  78. \n\n
  79. \n\n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n\n
  88. \n\n
  89. \n
  90. \n\n
  91. \n\n
  92. \n\n
  93. \n\n
  94. \n\n
  95. \n\n
  96. \n\n
  97. \n
  98. \n\n
  99. * Here&amp;#x2019;s one of the excel file holding all the formulas our scientist collaborators have painstakingly built.\n
  100. \n
  101. * Translation of excel formulas and vbscript (ack!) to Python\n
  102. \n\n
  103. \n\n
  104. \n\n
  105. \n\n
  106. \n\n
  107. \n
  108. \n
  109. \n\n
  110. \n
  111. \n
  112. \n
  113. * GIS is a really fascinating topic in the world of Python and Django.\n* I am new to the topic and have much to learn!\n* I will be happy to link up with any geodjango developers out there to share our skills and knowledge.\n\n