In this presentation, the essence of functional programming and Event Sourcing are explained and a code example of combining these two models is shown.
This presentation by Pawel Szulc (Scala Developer) was delivered at GlobalLogic Java Conference #2 in Krakow on April 23, 2016.
In this presentation, the essence of functional programming and Event Sourcing are explained and a code example of combining these two models is shown.
This presentation by Pawel Szulc (Scala Developer) was delivered at GlobalLogic Java Conference #2 in Krakow on April 23, 2016.
It was beginner's night at the Chicago R User Group. I presented on the basics of Data Munging---the skill of obtaining data and reworking it into more useful formats. This is a huge topic you can't possibly do justice to in a single presentation, but was intended to give the audience an overview to use help() for in the future, and motivate some R explorations
From Adam Hogan at Design & Analytics
These are my slides from a presentation to the Chicago R User Group on Oct 3, 2012. It covers how to use R and Gephi to visualize a map of influence in the history of philosophy.
More detail is available on the Design & Analytics Blog.
It was beginner's night at the Chicago R User Group. I presented on the basics of Data Munging---the skill of obtaining data and reworking it into more useful formats. This is a huge topic you can't possibly do justice to in a single presentation, but was intended to give the audience an overview to use help() for in the future, and motivate some R explorations
From Adam Hogan at Design & Analytics
These are my slides from a presentation to the Chicago R User Group on Oct 3, 2012. It covers how to use R and Gephi to visualize a map of influence in the history of philosophy.
More detail is available on the Design & Analytics Blog.
Customize the lightweight, versatile and powerful vim editor!
It's a programmable editor that has a great sense of humor. What else can you ask for? ;-)
PyDX Presentation about Python, GeoData and MapsHannes Hapke
This presentation introduces you to the basics of geospatial data and guides you through two examples for Django. First, you will learn how to program a small GeoDjango project. And secondly, you will learn how to extend the project with a few lines of code to turn the Django project into an API endpoint, which can be consumed by your mobile clients or java script single page applications.
2017 02-07 - elastic & spark. building a search geo locatorAlberto Paro
Presentazione dell'evento EsInRome del 7 Febbraio 2017 - Integrazione Elasticsearch in architettura BigData e facilità di integrazione con Apache Spark.
2017 02-07 - elastic & spark. building a search geo locatorAlberto Paro
Using Elasticsearch in a BigData environment is very simple. In this talk, we analyse what's Big Data and we show how it is easy integrating ElasticSearch with Apache Spark
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
As part of the GSP’s capacity development and improvement programme, FAO/GSP have organised a one week training in Izmir, Turkey. The main goal of the training was to increase the capacity of Turkey on digital soil mapping, new approaches on data collection, data processing and modelling of soil organic carbon. This 5 day training is titled ‘’Training on Digital Soil Organic Carbon Mapping’’ was held in IARTC - International Agricultural Research and Education Center in Menemen, Izmir on 20-25 August, 2017.
Scaling Up: How Switching to Apache Spark Improved Performance, Realizability...Databricks
Krux, a Salesforce company, is a Data Management Platform (DMP) that helps its clients collect, manage, analyze and activate their people data. With a wide range of premium clients such as Kellogg, L’Oréal, Warner Brothers, New York Times, Washington Post, Uber, Spotify and many other household names, they see over 3.5 billion unique users globally a month, across sites, media, mobile app, transactional and offline traffic sources. That is more than Facebook, Wikipedia and Twitter combined.
Processing this scale of data volume and velocity has presented many challenges over the seven years Krux has existed, and they had to develop various proprietary strategies and technologies to overcome those. In this session, Salesforce will share how Apache Spark, in particular, helped transform the DMP’s data processing infrastructure, using as an example the evolution of their “Look-alike” algorithm.
Look-alike, a similarity-based classifier, is one of the most commonly used algorithms by marketers and publishers looking to extend their audience reach. Get a high-level introduction to the use case and algorithm, and learn about Salesforce’s experience in moving the implementation from Hadoop to Spark and how it increased the performance, reliability and serviceability of the product. You will also hear about some of the technical challenges they faced, including large scale joins with skewed data, and how they solved those in Spark.
Learn how Spark provides a wide range of high-level and low-level APIs that prove useful when implementing customized machine learning algorithms as compared with Hadoop, and how the overall abstraction makes it very easy to develop modular and easy to maintain code that is also performant.
FOSSASIA 2018 Self-Sovereign Identity with Hyperledger Indy/SovrinCalvin Cheng
How can we leverage on distributed ledger technology and cryptography to provide identity as a global, cross-jurisdiction and accessible utility for the world?
Shared on 5th Dec at SGInnovate with Swirlds Mance Harmon, Jordan Fried and Edgar Seah.
Hashgraph consensus, demo apps in Swirlds Java SDK, babble (unofficial golang implementation of Hashgraph) and their implications for distributed ledger technology.
Functional Programming for OO Programmers (part 2)Calvin Cheng
Code examples demonstrating Functional Programming concepts, with JavaScript and Haskell.
Part 1 can be found here - http://www.slideshare.net/calvinchengx/functional-programming-part01
Source code can be found here - http://github.com/calvinchengx/learnhaskell
Let me know if you spot any errors! Thank you! :-)
Functional Programming for OO Programmers (part 1)Calvin Cheng
The Why and Benefits of Functional Programming paradigm. Part 2 with source code can be found here: http://www.slideshare.net/calvinchengx/functional-programming-for-oo-programmers-part-2
Related source code https://github.com/calvinchengx/learnhaskell
So, you want to build a Bluetooth Low Energy device?Calvin Cheng
What does it take to build a BLE device? What are the trends emerging in this Internet of Things era? This short presentation summarizes key aspects with respect to your market and product development considerations.
Shared with OneKind.Asia during a lunch time get-together. OneKind.Asia is an autonomous brand innovation company and a wholly-owned subsidiary of Ogilvy.
Learning iOS and hunting NSZombies in 3 weeksCalvin Cheng
Language (programming language) wars are overrated.
As a professional/career software engineer, it is our job to learn fast, evolve and continually grow in the context of different languages and software paradigms.
Learning Objective-C and iOS cocoa touch framework isn't as scary as people purport it to be. Ignore the critics, trust in your own abilities and dive into Objective-C if you need to build a mobile app for your company. Today.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
18. EXAMPLE OF AN AREA?
Conservation Forests, National Reserves etc
Borneo 743,330 square kilometres
19. 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.
29. 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
47. 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
48. 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()
49. 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()
52. GEOS Geometry Engine - Open Source
What does it do?
Works with django GIS app to give us GeoModels!
53. GEOS Geometry Engine - Open Source
Other Details
Required dependency for django GIS app
C++
Implements OGC simple feature for SQL specification
OGC = Open Geospatial Consortium
e.g. sudo port install geos
54. GDAL Geospatial Data Abstraction Library
What does it do?
Reads and writes to a variety of vector file formats, e.g. shp
55. GDAL Geospatial Data Abstraction Library
Other Details
C/C++
Implements OGC simple feature specification
e.g. sudo port install gdal
56. PROJ.4 Cartographic Projections Library
What does it do?
Manages spatial reference systems and projections e.g. the
mercator projection commonly used by Google Maps, MapQuest
etc
57. PROJ.4 Cartographic Projections Library
Other Details
Required dependency for PostGIS
C
Ensures that geometry objects stored in PostGIS use the
appropriate projection
sudo port install libproj4
58. Mapnik Toolkit for developing Mapping Applications
What does it do?
For the control freak in you :-)
Build your own maps, control and customize every single detail
59. Mapnik Toolkit for developing Mapping Applications
Other Details
C++
Uses boost for python interface
No py27-mapnik yet. Solution? Create your own local portfile
using py26-mapnik
sudo port install py27-mapnik
60. GeoIP Locate users by IP address
What does it do?
Determines the location of app user via user’s IP address
61. GeoIP Locate users by IP address
Other Details
C
No py27-geoip yet. Solution? Create your own local portfile using
py26-geoip
sudo port install libgeoip py27-libgeoip
65. $ ./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',
}
66. # 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',
}
67. 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)
76. $(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} )
77. // 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()
78. // 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' })
]);
79. // 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]
})
80.
81. // 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])
}
82. // 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() */
87. 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
88. 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
89. 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
90. The Problem with Android Google Maps Framework
Renders Google Maps of course
Support for alternative map sources is important
91. 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
92. Benefits
Fast
(obviously, since Map Tiles are stored locally)
100% Offline
Stored as blob data for SQLite Client Access
94. 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)
100. Crunch Collected Data
=>
2 possible approaches
- Decoupled R and Python
- Integrated Approach RPy Option
101. 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
102. 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
107. 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)
108. Species Extinction Calculator and REDDCalculator:
Mathematical Models and Formulas by Koh et. al are completely
translated into Python
Land Use Calculator:
Ditto. Coming Soon!
110. 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).
111. 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.
112. “ Advancing Environmental Sciences:
helping people, scientists, NGOs and governments make
practical Land Area Usage and Conservation Decisions
using jQuery (Mobile), OpenLayers and GeoDjango! ”
114. 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()
116. + 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
117. Stefan Talpalaru Liviu Bogdan Chiributa That’s Me! :-)
Odeon Consulting Group Odeon Consulting Group Odeon Consulting Group
+ ........
* hallo and thank you for joining me here to learn more about geodjango, jquery mobile and openlayers.\n* This is my first time at europython and I am glad to be here, learning so much from you, my python peers.\n
* I am Calvin and I work as a user-interface/python developer in a company incorporated in Singapore.\n* We are a very small and relatively young software development team (3-4 years old), but our company is unusual because we work with customers from all over the world.\n* We are very fortunate to be able to work on some really fascinating projects and amazing customers for the past 2 to 3 years.\n* We have built all sorts of application including game and social network ones.\n* But over the past couple of years, we have discovered that we are especially passionate about building software related to science.* Specifically, in our various projects with ETH Zurich, I am learning a lot about GIS (Geographical Information System) in relation to Conservation Biology and Environmental Science.\n* In a separate and unrelated project with the University of Southern California, our team has the opportunity of helping neuroscience researches archive and understand neural circuitry - a fascinating and ever-evolving domain as scientists learn more about different parts of the mammalian brain. \n
* 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&#x2019;s nuts but that&#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
* We will of course, have some code examples showing how we set up the Models in our environmental science apps and how we use the GeoDjango ORM to update our database with information from the user or from existing shapefile datasource.\n* In order for us to work effectively, it also helps to understand a little about what goes on behind the scenes and what each of the geospatial libraries we have installed do.\n* It also helps for us to understand some of the helper functions, otherwise known as utilities, in GeoDjango helps make life easier when we want to inspect a shape file or write our model knowing what to expect from the shape file.\n\n
* Part of what makes django so wonderful is its django admin feature. The good news, of course, is that when geodjango was officially merged into django trunk as the GIS contrib app, they have also made GeoAdmin awesome by automagically showing the geographical feature on a map using openlayers in the admin.\n* Section 8 and 9 actually go hand-in-hand together and I will show you some example javascript code there.\n
* In the last part of my presentation, I will explore different ways, possible ways to improve the app in our next development iteration.\n* And finally, summarize the lessons learnt in our first development iteration.\n
\n
* There are 3 tools under active development for environmental scientists at ETH Zurich.\n* The first app is reddcalculator.com, which is a tool to illustrate socioeconomic consequences, job losses and gains as a result of implementing the Norway-Indonesia REDD Moratorium.\n* REDD stands for &#x201C;Reducing Emissions from Deforestation and Forest Degradation in Developing countries&#x201D;.\n* The idea is to assign a financial value for the carbon stored in forests and offer incentives for developing countries to reduce emissions from forested lands and invest in low-carbon paths to sustainable development.\n* The 2nd tool is species extinction calculator, which is a mathematical model designed by a group of Environmental Scientists, Koh Et Al, to predict species loss as a consequence of change in their habitat or the landscape.\n* The land use calculator is a generalized model, similar to what we have already done in reddcalculator.com and predicts socioeconomic consequences of land use decisions and policies. \n\n
* We will begin by talking about the Species Extinction Calculator, an app which is currently under closed beta.\n
* Orangutan\n* Clouded Leopard\n* Pygmy Elephants\n* Sumatran Rhino\n* These are the 4 major species that are going extinct in a South East Asian island called Borneo.\n* As our human activities reduce the natural habitats, forests and food available to these species, they are directly affected and begin to disappear from Earth.\n* While I am not a green activist or terrorist, it saddens me that the species diversity in this world are dramatically reduced as a consequence of our actions.\n* Following Ms Ravenscroft admonition to adopt Diversity as a Dependency in the Python community on Monday, I am proposing that we consider our friends in the animal kingdom part of beauty and diversity of the Python community.\n* After all, Python&#x2019;s logo is pretty much represented by 2 very cute blue and yellow snakes.\n* So, on a serious note, this project is very much about using Python code to help decision makers understand the consequence of their actions and help people make better decisions on land use and socio-economic tradeoffs.\n
* 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
* Here&#x2019;s a graphical representation of the Arrhenius formula.\n* But of course, this is an outdated model and is wildly inaccurate.\n
* 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
* 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 &#x201C;Total Landscape Area&#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
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
* Koh et al&#x2019;s improved model addresses those shortcomings by accounting for how species respond to changes in composition & 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
* 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
* 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's land area. It has the oldest rainforest in the world ahead of the Amazon rainforest inBrazil.\n
* 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
* Loss of species, carbon emissions as a balance against employment and financial losses\n\n
* Here&#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
\n
* The user interface\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
* &#x201C;from django.db import models&#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
* add the geometry field you need. in this example, &#x201C;geom&#x201D; is our geometry field and it is a contains a MultiPolygon object using the datum WGS84 (i.e. 4326)\n* \n\n
* 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
* &#x201C;from django.db import models&#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
\n\n
* represented by coordinates, specific to the projection or datum\n\n
* represented by coordinates, specific to the projection or datum\n\n
* represented by coordinates, specific to the projection or datum\n\n
* represented by coordinates, specific to the projection or datum\n\n
* represented by coordinates, specific to the projection or datum\n\n
* obviously :-) more than 1 or more Polygons stored in this field!\n\n
* A collection of different geometries can be stored in the field\n\n
* Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
* Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
* Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
* Here&#x2019;s an example showing you how I have set up our AreaData class. The attributes in the AreaData class includes the MultiPolygonField as well as other information I need for Species Extinction computation.\n\n
* Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
* ogrinspect is a really useful django management command which comes with django.contrib.gis.\n* It inspects a given .shp file (Shape File) and auto generates a suggested model and LayerMapping dictionary.\n\n
* So as suggested by ogrinspect, we should define the location_mapping dictionary if we decide to use the LayerMapping utility to import shapefile data into your postgis database.\n\n
* Using GeoDjango APIs with a model containing a MultiPolygonField!\n* The strict parameter, when True, is to stop the execution of model mapping upon the first error encountered. For me, I wanted to know when an error has occurred when I importing the data in the shapefile, hence, I specify it to be True. The default is False, which means that it will attempt to continue even if it encounters an error.\n\n
\n
* Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
* Using GeoDjango APIs with a model containing a MultiPolygonField!\n\n
\n
\n
\n
\n
\n
\n
\n
* Here, in this OpenLayer javascript, we define custom controls for the user and assign it to the toolbar variable, which is later on assigned to the controls attribute in the next slide.\n
* Placing the various map options from Google Map Source, and in the above code, rendering the Google Hybrid code in priority.\n* Google Hybrid. Google Physical. Google Street Maps. Google Satellite.\n* backgroundLayer contains holds the grey border, transparent polygon -> &#x201C;Total Landscape Area&#x201D;, more expressively understood as &#x201C;the area we are interested in&#x201D;\n* polygonLayer contains either the &#x201C;Before&#x201D; we change the landscape polygons, each representing different landscape type (which is referred to by the scientists as a &#x2018;Matrix&#x2019;)\n* Or &#x201C;After&#x201D;.\n* Once we have &#x201C;Total Landscape Polygon&#x201D; defined, &#x201C;Before polygons defined&#x201D;, &#x201C;After polygons&#x201D; defined, we can compute &#x201C;expected species loss&#x201D;\n
* Here, you can visualize what I just explained.\n
* When we first define our Total Landscape Area polygon, we don&#x2019;t need the backgroundLayer.* The backgroundLayer is intended to display the Total Landscape Area polygon already defined when the User is plotting out his &#x201C;Before&#x201D; or &#x201C;After&#x201D; polygons.\n
\n
\n
\n\n
\n\n
* The user interface comprising jQuery Mobile and OpenLayers could be completely replaced by native ones so land surveyors can work independent of 3G/Edge Network availability.\n* Sending field data into the server only when 3G/Edge Network are available.\n
\n
\n
\n
\n
\n
* MBTiles is a specification for storing tiled map data in SQLite databases for immediate use and for transfer. The files are designed for portability of thousands, hundreds of thousands, or even millions of standard map tile images in a single file.* This makes it easy to manage and share map tiles\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
* There are interesting products and satellite services in the market that work with Android and iOS devices.\n* An example is TomTom. This is something I have yet to explore in detail but it is an interesting feature that would empower field work for scientists and land owners where terrestrial 3G network isn&#x2019;t available.\n
\n\n
* Here&#x2019;s one of the excel file holding all the formulas our scientist collaborators have painstakingly built.\n
\n
* Translation of excel formulas and vbscript (ack!) to Python\n
\n\n
\n\n
* The geography argument in our GeoDjango field is an important factor when considering the accuracy of the area in your defined Polygon.* The default is False. When we specify it to be True, area computation for the given Polygon or MultiPolygon assumes a surface area on an ellipsoidal earth. \n* This computation is done at the expense of some performance loss.\n* geography=False computes area ased on a flat, 2D polygon area.\n* LayerMapping versus directly assigning to \n\n
\n\n
\n\n
\n
\n
\n
\n
* First, I must say that django GIS&#x2019;s documentation is kickass. If my presentation is not clear in anyway, I am pretty sure Django GIS documentation will help you out.\n* I have also listed a very comprehensive list of really good presentations relating to GeoDjango. If you are serious about GIS development, I encourage you to go through every single one of them.\n* I will, of course, upload this presentation, my little contribution to the fascinating world of GeoDjango online. You should be able to find it on the 2nd url by tomorrow.\n
* 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