Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering...
Transcript of Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering...
Health and Mapping
Barry [email protected]
School of Health and Medicine,Lancaster University
Delivering mapping solutions: the open source advantage
Note
This PDF document is a conversion of the original animated presentation. Most of the navigation and interaction is lost but you may still page through the document.
The Open Source Advantage
What software is there?
What is 'Open
Source'?
Show me some case-
studies!
What is Open Source?
● A Philosophy● A Methodology● A Community
What is Open Source?
Get yourcode toanyonewhowants touse it.
Free Distribution
Open Standards
Your data... ...locked bysomeone's key
Proprietary standards give you...
Open Standards
Your data... ...as an openbook
Open standards give you...
What about support?
Proprietary support
I can call the vendor!
But they don'thave to fix it
Unless I pay themfor a support contract
Which they have amonopoly on!
Open Source Support
There's no vendor to call...?
...but anyone onthe planet can help!
!!
!
As ever, you canalways pay for it...
!!!
From a wide-open market of suppliers!
RadiantBlue
Open Source GeoServices
OpenApp
WhereGroup
Faunalia
GlobalImage
OA DigitalCampToCamp
OSGISServices
Just a few from the osgeo.org support directory of hundreds.
Some OSGeo commercial support companies...
Finding Developers
Conferences,workshops,meetings
Project emaillists
Online chatrooms
Want to see a bug fixedin under an hour by anopen-source developer?
Fixed in 60 Minutes12:13:30 arkygeek: timlinux: was there an issue with feature info for
rasters not staying in front?12:14:34 ADKPete: arkygeek: feature info?12:14:51 arkygeek: identify features sorry12:15:58 ADKPete: arkygeek: ok, that is what I thought but wanted to
double check. Dialog not staying on top?12:17:46 arkygeek: ADKPete: just checking its happeining in head12:18:15 arkygeek: it IS NOT staying in front on head12:18:37 ADKPete: hmmm...don't get that here what OS?12:18:39 arkygeek: open a raster, identify feature, then on the
second identify attempt it goes to the back12:18:41 arkygeek: osx12:18:50 ADKPete: well there you go....12:18:52 ADKPete: : )12:19:01 arkygeek: :P12:19:11 arkygeek: svn updating12:20:47 arkygeek: it was the same in v.1112:21:40 arkygeek: yeah, still there in r964412:32:30 ADKPete: arkgeek: Think I have the fix for you. building...12:43:10 CIA-7: ersts * r9645
/trunk/qgis/src/app/qgsmaptoolidentify.cpp: -Added a raise call to keep the identify results dialog on top when clicking through rasters
12:43:20 ADKPete: arkygeek: try that...12:54:12 arkygeek: updating12:55:07 arkygeek: compiling12:55:53 arkygeek: ADKPete: that did it. well done :- )12:56:02 ADKPete: groovy
At 12:13 Jason thinks he sees a problem with a dialog box...
A minute later Pete asks for clarification
Some gentle anti-Mac banter follows
Jason confirms the bug with the latest
revision 9644
Pete has a fix
A robot notifies thechat of Pete's change
Jason tries and it now works. It's 12:55
The Full Stack
Desktop GIS(Qgis, gvSig, GRASS,...)
Web Clients(OpenLayers, ...)
WCS(grid data)
WFS(feature
data)
WMS(images)
Map Servers(MapServer,...)
Catalog Servers(GeoNetwork,...)
GeoDatabases(PostGIS, SpatiaLite,...)
File System(Shapefiles, GML, GeoTiff,...)
Databases
Servers
Interfaces
Clients
Desktop GIS(Qgis, gvSig, GRASS,...)
Grass GIS
GRASS is a high-powered and technical set of GIS tools.
more...
Programs that run on yourpersonal computer
QGIS is aGIS andmapping package written in C++ and Python. It can beextended with plugins. more...
gvSIG is a GISand mappingpackage written inJava.
more...
● And there are others!
Web Clients(OpenLayers, MapServer,...)
Alternatives to Google's Map API, Bing Maps, Yahoo Maps etc
A client-server webmapping systemwith many server-side possibilities
more...
A purely browser-based web mapping solution in JavaScript more...
OpenLayers
<html><head> <title>OpenLayers Example</title> <script src="http://openlayers.org/api/OpenLayers.js"> </script></head><body> <div style="width:100%; height:100%" id="map"></div> <script defer="defer" type="text/javascript"> var map = new OpenLayers.Map('map'); var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); map.addLayer(wms); map.zoomToMaxExtent(); </script></body></html>
This bit of HTML/JS... ...produces this map in your browser
That is a complete example. With just a fewlines of code you get a dynamic 'slippy map' in your web browser.
But wait, there's more....
OpenLayers
● Build complex interactive web sites:
Integrate with other javascript widgets
Multiple map data overlays
Interactive pop-up info
bubbles
Base layer from many
data providers
GeoNetwork
Spatial DataCatalogue
●Search●Index●Catalogue●Serve
WCS(grid data)
WFS(feature
data)
WMS(images)
Serving spatial data over the internet
Request
Server thinks...
ResponseBrowser draws
WCS(grid data)
WFS(feature
data)
WMS(images)
Web service mashups
Background imagery
Polygonoverlays
Regionaldata
GPS locations
Integrate data sourcesfrom multiple providersto produce new maps
and insights
All using open source servers, clients and communications protocols!
WCS(grid data)
WFS(feature
data)
WMS(images)
GeoDatabases(PostGIS, SpatiaLite,...)
Relational Databases with spatial data functions
select ADMIN_NAME,GMI_ADMIN,POP_ADMIN from bounds.uk
Databases use SQL...
ADMIN_NAME | GMI_ADMIN | POP_ADMIN ------------------+-----------+----------- England | GBR-ENG | 48346580 Northern Ireland | GBR-NIR | 1577836 Scotland | GBR-SCT | 5160818 Wales | GBR-WLS | 2912776
...to get table data
GeoDatabases(PostGIS, SpatiaLite,...)
Relational Databases with spatial data functions
select ADMIN_NAME,GMI_ADMIN,POP_ADMIN,the_geom from bounds.uk
Spatial databases also use SQL...
ADMIN_NAME | GMI_ADMIN | POP_ADMIN | the_geom ------------------+-----------+-----------+---------- England | GBR-ENG | 48346580 | 1022183.. Northern Ireland | GBR-NIR | 1577836 | 1212732.. Scotland | GBR-SCT | 5160818 | 1A83326.. Wales | GBR-WLS | 2912776 | 1B76623..
...to get table data with geometry!
GeoDatabases(PostGIS, SpatiaLite,...)
Relational Databases with spatial data functions
the_geom ---------- 1022183.. 1212732.. 1A83326.. 1B76623..
the_geom stores geography
GeoDatabases(PostGIS, SpatiaLite,...) Spatial Queries
name | roads_km--------------------+----------- SURREY | 1539.4755VANCOUVER | 1450.3309 LANGLEY DISTRICT | 833.79339 BURNABY | 773.76909 PRINCE GEORGE | 694.37554
What is the length of roads fully contained within each municipality?
SELECT m.name, sum(ST_Length(r.the_geom))/1000 as roads_km FROM bc_roads AS r, bc_municipality AS m WHERE ST_Contains(m.the_geom,r.the_geom) GROUP BY m.name ORDER BY roads_km;
Spatial query functions
● Adds spatial functions to PostgreSQL
● Access from most GIS (open source and commercial)
● Keep spatial and non-spatial data in the same DB
● Client-server model
The basis of thousands of spatialdata infrastructures worldwide
SpatiaLite
● Lightweight, but fully functional
● Designed for personal geo-databases
● Single-user
● Support building fast!
● Comes with simple mapping app
● Vector and Raster mapping
● Analysis tools
● Plugin architecture for extensions in Python
● Reads most spatial data
● Talks to map servers
● Talks to database servers
● Vector and Raster mapping
● Analysis tools
● Plugin architecture for extensions in Java
● Reads most spatial data
● Talks to map servers
● Talks to database servers
Grass
● Heavyweight GIS Toolkit
● Vector, Raster, Network
● 2d and 3d
Case Studies
● Aegiss– A web-based system for mapping
symptoms and detecting outbreaks
● Arlat– Modelling and mapping parasite
incidence in the field.
Case Study: Aegiss
people
eat
bad food
and get sick
so they callNHS Direct...
...whofigure outwhat's wrongand help
and then filethe results
away somewhere
Statistical Analysis
hi
low
Risk surface
Case locations, population data
casespopulation
= prob(outbreak)
Job
● Get the data from NHS
● Process it
● Trigger alerts on possible outbreaks
● Produce nice maps for health professionals
Sending the data
Data copied from NHSnetwork to internet PC
NHS
Daily symptom dataextracted from NHSDirect database
NHS
Data encrypted andemailed to Lancaster- using open-sourcepublic-key crypto
Receiving the data
Data comes in to databaseserver and is decrypted
Midnight jobprocesses daily
data
Results stored inspatial data files
Stored in a Postgresdatabase system
Viewing the data
User requests web pageusing their browser
Web server gets dataand builds page
User interacts withmap on web page
Web page breakdownTraffic light systemshows possibleoutbreak status
Dynamic map made using OpenLayers
Calendar built with the OpenSource
YUI Toolkit
Query data points for drill-down info
Switch map layers on and off
Hotspot layer highlights possible
outbreaks
Background image from OpenStreetMap
Case Study: Arlat
Mectizan protectspeople from onchocerciasis
(river blindness) spread by blackfly
Arlat
But it can sometimes cause seriousadverse effects in people with therelatively harmless Loaloa worm
+ =
So we need to know...
Parasitological Sampling
Blood analysisis slow and expensive –but it is accurate
Questionnaire Surveys
Questionnairesampling ('have you ever had eyeworm?') isquick and cheap – but itis imprecise
Satellite Data
Satellite datatells us aboutthe habitatsuitability forLoaloa
Combining Data
Combining allthe data needs some clever statistics- a bivariate binomial model with covariates
The Statistics
Satellite data
Survey data, old and new
Parasitology fromblood samples
bivariate binomialspatially correlated
model with covariates
Predictions
Arlat
● Needs to be done by non-technical staff
● Working in the field
● So built as a plugin to Quantum GIS
● Using R for computing the statistics
● Runs on Windows and Linux
How does it go?
Researcher inthe field doesquestionnairesurvey to getquick andcheap Loa-loaestimates
How does it go?
Researcher puts the dataand locationsinto aspreadsheet
How does it go?
Data is loadedinto QuantumGIS anddisplayed withbackgroundlayers
How does it go?
With a few clicks,a risk exceedencesurface appears!
Blue – all clear
Red – danger zone
Grey – more data
needed
Under the Hood
...is written in C++...
...and has anembeddedPython interpreter...
...which calls Rto do statistics.
Under the Hood
QGIS handles all the mappingand gives us an interfaceto map data
Python gives us rapidapplication developmentand access to GUIfunctions
R provides thestatisticalfunctions weneed
Open Source Power
● A purely open-source application
● Combining several best-of-breed applications
● Even the Windows Installer is Open-Source
● Zero licensing cost
● Zero distribution cost
● Zero usage restrictions