delivering mapping solutions: open source advantage › ~rowlings › chicas › ...delivering...

59
Health and Mapping Barry Rowlingson [email protected] School of Health and Medicine, Lancaster University Delivering mapping solutions: the open source advantage

Upload: others

Post on 29-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

Health and Mapping

Barry [email protected]

School of Health and Medicine,Lancaster University

Delivering mapping solutions: the open source advantage

Page 2: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

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.

Page 3: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

The Open Source Advantage

What software is there?

What is 'Open

Source'?

Show me some case-

studies!

Page 4: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

What is Open Source?

● A Philosophy● A Methodology● A Community

Page 5: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

What is Open Source?

Read,Learn,Improve!

CodeAccess

Page 6: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

What is Open Source?

Get yourcode toanyonewhowants touse it.

Free Distribution

Page 7: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Open Standards

Your data... ...locked bysomeone's key

Proprietary standards give you...

Page 8: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Open Standards

Your data... ...as an openbook

Open standards give you...

Page 9: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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!

Page 10: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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!

Page 11: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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...

Page 12: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Or fix it yourself...

You have thesource code!

Page 13: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Free Support

The Developer... ...is also a user!

Page 14: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Free Support

Fixing bugs... ...helps them AND you!

Page 15: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Finding Developers

Conferences,workshops,meetings

Project emaillists

Online chatrooms

Want to see a bug fixedin under an hour by anopen-source developer?

Page 16: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 17: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 18: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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...

Page 19: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

● 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...

Page 20: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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....

Page 21: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 22: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Framework forweb mapping

Client-serverarchitecture

Page 23: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

GeoNetwork

Spatial DataCatalogue

●Search●Index●Catalogue●Serve

Page 24: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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)

Page 25: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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)

Page 26: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 27: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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!

Page 28: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

GeoDatabases(PostGIS, SpatiaLite,...)

Relational Databases with spatial data functions

the_geom ---------- 1022183.. 1212732.. 1A83326.. 1B76623..

the_geom stores geography

Page 29: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 30: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

● 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

Page 31: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

SpatiaLite

● Lightweight, but fully functional

● Designed for personal geo-databases

● Single-user

● Support building fast!

● Comes with simple mapping app

Page 32: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

● Vector and Raster mapping

● Analysis tools

● Plugin architecture for extensions in Python

● Reads most spatial data

● Talks to map servers

● Talks to database servers

Page 33: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

● Vector and Raster mapping

● Analysis tools

● Plugin architecture for extensions in Java

● Reads most spatial data

● Talks to map servers

● Talks to database servers

Page 34: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Grass

● Heavyweight GIS Toolkit

● Vector, Raster, Network

● 2d and 3d

Page 35: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Case Studies

● Aegiss– A web-based system for mapping

symptoms and detecting outbreaks

● Arlat– Modelling and mapping parasite

incidence in the field.

Page 36: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 37: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

We want to add value to that data

Page 38: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Statistical Analysis

hi

low

Risk surface

Case locations, population data

casespopulation

= prob(outbreak)

Page 39: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Job

● Get the data from NHS

● Process it

● Trigger alerts on possible outbreaks

● Produce nice maps for health professionals

Page 40: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 41: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 42: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Viewing the data

User requests web pageusing their browser

Web server gets dataand builds page

User interacts withmap on web page

Page 43: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 44: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Case Study: Arlat

Mectizan protectspeople from onchocerciasis

(river blindness) spread by blackfly

Page 45: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Arlat

But it can sometimes cause seriousadverse effects in people with therelatively harmless Loaloa worm

+ =

So we need to know...

Page 46: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Where is the Loaloa?

?

Page 47: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Parasitological Sampling

Blood analysisis slow and expensive –but it is accurate

Page 48: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Questionnaire Surveys

Questionnairesampling ('have you ever had eyeworm?') isquick and cheap – but itis imprecise

Page 49: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Satellite Data

Satellite datatells us aboutthe habitatsuitability forLoaloa

Page 50: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Combining Data

Combining allthe data needs some clever statistics- a bivariate binomial model with covariates

Page 51: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

The Statistics

Satellite data

Survey data, old and new

Parasitology fromblood samples

bivariate binomialspatially correlated

model with covariates

Predictions

Page 52: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 53: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

How does it go?

Researcher inthe field doesquestionnairesurvey to getquick andcheap Loa-loaestimates

Page 54: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

How does it go?

Researcher puts the dataand locationsinto aspreadsheet

Page 55: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

How does it go?

Data is loadedinto QuantumGIS anddisplayed withbackgroundlayers

Page 56: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

How does it go?

With a few clicks,a risk exceedencesurface appears!

Blue – all clear

Red – danger zone

Grey – more data

needed

Page 57: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

Under the Hood

...is written in C++...

...and has anembeddedPython interpreter...

...which calls Rto do statistics.

Page 58: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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

Page 59: Delivering mapping solutions: open source advantage › ~rowlings › Chicas › ...Delivering mapping solutions: the open source advantage. Note This PDF document is a conversion

[email protected]

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