sensor web enablement @ ircel - celine › files › sensorweb › gswconference2016 › ...sensor...

28
Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive analyses 3) a Cordova mobile app Olav Peeters Belgian Interregional Environment Agency (IRCEL – CELINE)

Upload: others

Post on 08-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

Sensor web enablement @ IRCEL - CELINE1) SOS for e-reporting,

2) Shiny/R for advanced interactive analyses 3) a Cordova mobile app

Olav Peeters

Belgian Interregional Environment Agency (IRCEL – CELINE)

Page 2: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

2

Content● Who are we (IRCEL – CELINE) and what do we do?

● Our spatial data infrastructure (SDI)

● Extension of the SOS for e-reporting and INSPIRE

● Shiny webapps with (real-time) data via a REST-api

– sensorweb4R

– sensorweby

● A Cordova mobile app

● Future developments

Page 3: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

3

IRCEL – CELINE

Intergewestelijke Cel voor het Leefmilieu (IRCEL)

Cellule Interrégionale de l'Environnement (CELINE)

Belgische Interregionale Umweltagentur (IRCEL - CELINE)

Belgian Interregional Environment Agency (IRCEL - CELINE)

Cooperation agreement between the three Belgian regions

(VMM) Leefmilieu Brussel -Bruxelles Environnement

Agence wallonne de l'Air et du Climat (AWAC)

Page 4: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

4

IRCEL – CELINE

The three Belgian networks

Page 5: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

5

IRCEL – CELINE

● Most important functions of IRCEL - CELINE (air quality):

– Continuous forecasts (cf SMOG alert)

– Informing the public on air quality (real-time and assessment)

– National report under the air quality directive (2004/107/EC)

– Enforcing a common scientific basis between monitoring networks

– Interregional calibration laboratory

– Interregional data processing centre (IDPC) - real-time database

● National Focal Point (Eionet)

● Compilation GHG inventory

Page 6: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016 6

IRCEL – CELINEhttp://www.irceline.be- Real-time data- All major pollutants(incl. BC)- Forecasts- Information aboutpollutants- Publications- etc.

Integration of OGC-servicesinto website (leaflet.js)

… and tables with (real-time) data:

Page 7: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016 7

Overview SDI @ IRCEL - CELINE

Real-time validated

Desktop applications

Brussels Environment

Viewing services (WMS)

Download service (WFS, SOS,

REST-api)

Static png, XML,

txt, etc.

AWACVMM

geo.irceline.be

ETL

Page 8: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016 8

E-reporting and Air Quality

Implementing Provisions for Reporting

(IPR)2011/850/EU

Exchange ofInformation

Decision97/101/EC

4th Air QualityDaughterDirective

2004/107/EC

Air Quality Directive

2008/50/EC

XML-schema(AQD-xsd) Guidance document

Page 9: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

9

E-reporting under the IPR

Before:

After:

EEA

Regional agency

Regional agency

Regional agency

Air QualityQuestionnaire

(.xls)

National Node

Transmission .xlsafter approval from

ministries

EEA

Regional agency

Regional agency

Regional agency

National Node

INSPIRE-compliant transmission (cf 2011/850/EU)

Internaldataflows Transmission XML

after approval fromministries

Page 10: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

10

E-reporting: the data flows involved

INPIRE DataTheme

Content

III.11.AM Dataset B – "zones and agglomerations"

III.11.AM Dataset C – "assessment regime"

III.11.AM Dataset D – "assessment methods"

III.7. EF Dataset E1a – “primary validated assessment data – measurements”

III.13 AC Dataset E1b – “primary validated assessment data – modelled”

III.7. EF Dataset E2a – “primary up-to-date assessment data – measurements”

III.13 AC Dataset E2b – “primary up-to-date assessment data – modelled”

III.7. EF Dataset F1a – “aggregated data - primary validated measurements”

III.13 AC Dataset F1b – “aggregated data - primary validated modelled”

III.7. EF Dataset F2 – “aggregated data - primary up-to-date measurements”

III.11.AM Dataset G – “attainment of environmental objectives”

III.11.AM Dataset H – “air quality plans”

III.11.AM Dataset I – “source apportionment”

III.11.AM Dataset J – “scenario for the attainment year”

III.11.AM Dataset K – "measures"

+ a header transmitted with every separate submission

(cf Implementing Provisions for Reporting (IPR) 2011/850/EU)

colours represent similar data types

Page 11: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016 11

E-reporting: plenty of ways to skin the cat

DBxDB1

Database layer

Data acquisition

Monitoring network A Monitoring network x

Data extraction layer

EC Interest group X

CustomScripts

(PHP, java,python, ...)

Desktoptool

(cf AQUI)

web basedtool

(cf AQR-system)

OGC –services

(WFS, SOS, WCS, etc.)

ETL –tool

(HALE, FME etc.)

Page 12: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

12

Sensor observation services (SOS)

http://sos_client.irceline.be

http://sos.irceline.be

Geographic position

Timestamp & measured concentrations (e.g. 24 hours)

- Efficient transmission of time series

- queryable:

Extended for e-reporting

since version 4.3.x

… an INSPIRE compliant downloading service

http://viewer.irceline.be

Page 13: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

13

SOS and the IPR (and INSPIRE)

● The IPR data model expects some extra elements

– startTime and endTime

– Validity and verification flag

– The IPR header

● More convenient to have IPR specific interpretation ofstandard SOS elements

– e.g. URI's as pollutant names (also solved with flexible identifiers)

● INSPIRE specifications for downloading services

– Service has to be able to handle multilingual

– Return geometry in multiple coordinate systems

– Some extra metadata elements

See: https://ies-svn.jrc.ec.europa.eu/projects/download-services-tg/wiki/ARE3NA_SOS_study

Page 14: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

14

SOS and the IPR (and INSPIRE)

http://geo.irceline.be/sos/client

Page 15: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

Documentation● General documentation SOS server

– https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation

● INSPIRE Download Service extension

– https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation#INSPIRE_Download_Service_extensi

● About the additional elements/functionalities for e-reporting

– https://wiki.52north.org/bin/view/SensorWeb/AqdEReporting

● Flexible identifiers

– https://wiki.52north.org/bin/view/SensorWeb/FlexibleIdentifier

Page 16: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

Viewer of EU up-to-date dataData availability during summer-SMOG episode last week

Page 17: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

17

Shiny webapps for advanced interactiveR-analyses

http://www.openair-project.org A package for R specifically for the air quality community

How to integrate the power of R intoan SDI?- SOS4R: existing SOAP (xml) basedimplementation → to slow for longertime series

http://shiny.rstudio.com/

Page 18: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

18

Faster data access via a REST-api

http://52north.github.io/sensorweb-rest-api/http://52north.github.io/js-sensorweb-client/

As part of the SOSimplementation of 52°North

Page 19: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

19

Shiny webapps for advanced interactiveR-analyses

Page 20: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

20

Shiny webapps for advanced interactiveR-analyses

PollutionRose Select time series (jsClient)scatterPlot (per season, etc.)

calendarPlotscatterPlot with model evaluation

ScatterPlot (hexbin)

Page 21: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

21

Shiny webapps for advanced interactiveR-analyses

● https://github.com/52North/sensorweb4R

● https://github.com/52North/sensorweby● http://blog.52north.org/2015/04/22/advanced-time-series-analysis-on-the-web-with-r/

(google “blog sensorweby”)

● You can run this locally in R-Studio or on a remote Shinyserver

● Example apps: http://shiny.irceline.be/examples/

● Better security since there is no direct DB-connection

● REST is still very fast data access

Page 22: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

22

A Cordova mobile app

● Apache Cordova is the open source project behind AdobePhoneGap

● Build apps with HTML, CSS and JavaScript

● Does not have the best reputation, but we don't have anycomplaints (google for “tips cordova”)

● Online build via https://build.phonegap.com

● Android, iOS and Windows Phone

● We hooked the JsClient for time series data into Cordova

● Added WMS layers to the Leaflet.js map view + otherJavaScript customisations

Page 23: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

23

A Cordova mobile appReal-time data Forecasts

Resizes well for tablets

Multilingual (EN, NL, FR, DE)http://www.eenvplus.eu/

Interactive data exploration

Page 24: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

24

A Cordova mobile apphttps://github.com/irceline/air-quality-belgium-apphttps://github.com/irceline/js-sensorweb-client-app (generic)

https://build.phonegap.com/apps/1509550/builds

Page 25: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

25

App published in all major app stores

Google Play store Windows Phone app store

Search for: Air Quality Belgium

iTunes store

Page 26: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

26

Using sensor data to style SVG-icon

var svg_icon_begin = "<svgxmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'xmlns='http://www.w3.org/2000/svg' height='32' width='32'version='1.1' xmlns:cc='http://creativecommons.org/ns#'xmlns:dc='http://purl.org/dc/elements/1.1/' viewBox='0 035.433071 35.433071'><metadata><rdf:RDF><cc:Workrdf:about=''><dc:format>image/svg+xml</dc:format><dc:typerdf:resource='http://purl.org/dc/dcmitype/StillImage'/><dc:title/></cc:Work></rdf:RDF></metadata><path fill-rule='evenodd'fill='#000000' d='m12.027 3.7 5.69 28 5.69-27.942-5.69 4.5127z'transform='rotate(";

var svg_rotation = elem.getLastValue().value;var svg_icon_end = " 16 16)'/></svg>";var svg_icon = svg_icon_begin.concat(svg_rotation,svg_icon_end);var svg_icon_base64 = "data:image/svg+xml;base64,"+ btoa(svg_icon);

Page 27: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

30/08/2016

27

Future developments● Further refinement of the timeseries-api

● Implement the new js-client (desktop version & in mobileapp)

● Extending sensorweb4R (cf extended specification) andsensorweby

● Adding alerts to the Cordova app

● Serving raster via SOS (SOAP and REST?) for timeanimation of raster

● Using real-time hi-resolution air quality maps as input for arouting-API to calculate the “healthiest route”, by bike, byfoot and if you have to, by car.

Page 28: Sensor web enablement @ IRCEL - CELINE › files › sensorweb › GSWConference2016 › ...Sensor web enablement @ IRCEL - CELINE 1) SOS for e-reporting, 2) Shiny/R for advanced interactive

28

Thank you!

Olav Peeters

Belgian Interregional Environment Agency (IRCEL – CELINE)