analyze your smart city: build sensor analytics with ogc sensorthings api

38
#3: Analyze Your Smart City - Build Sensor Analytics with OGC SensorThings API Dr. Steve Liang, Ph.D., P.Eng. Founder and CEO, SensorUp Inc. Associate Professor, University of Calgary Click here for webinar recording Click here for source codes

Upload: sensorup

Post on 08-Jan-2017

115 views

Category:

Internet


2 download

TRANSCRIPT

Page 1: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#3: Analyze Your Smart City - Build Sensor Analytics with OGC SensorThings API

Dr. Steve Liang, Ph.D., P.Eng. Founder and CEO, SensorUp Inc. Associate Professor, University of Calgary

Click here for webinar recording Click here for source codes

Page 2: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

About Dr. Steve Liang๏Associate Professor, Geomatics Engineering, Uni. Calgary

๏AITF-Microsoft Industry Research Chair on Open Sensor Web (2011~2014)

๏Chair OGC SensorThings API Standard Working Group

๏Rapporteur, ITU-T SG12/11 on Internet of Things Test Specifications

๏Founder and CEO, SensorUp Inc

Page 3: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

About SensorUp๏We are a leader in Sensor Web

and IoT Platforms.

๏We offer innovative and comprehensive SensorThings solutions.

๏We are proud member of Eclipse and Open Geospatial Consortium

Page 4: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

News - SensorThings API Press Release

Page 5: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

News - OGC SensorThings High-Chart and Data-Table (HCDT) Library

http://www.sensorup.com/sensorthings-high-chart-and-data-table-hcdt/

Page 6: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

News - Calgary air quality update

Page 7: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

News - Calgary air quality update

Page 8: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Useful Resources

Step #1: SensorThings Playground

http://pg.sensorup.com

Step #2: SensorThings Scratchpad

http://scratchpad.sensorup.com

Page 9: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

What will be covered in this webinar series

Sense Your Smart City: Connect Environmental Sensors to SensorThings API

Visualize Your Smart City: Build a Real-Time Smart City Dashboard for SensorThings API

Analyze Your Smart City: Build Sensor Analytics with SensorThings API

Build Interoperable Smart City Applications Effortlessly

Page 10: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Today’s learning outcomes

๏Review of SensorThings entities (ISO 19156 O&M)

๏Pie chart of air quality readings (good, moderate, unhealthy)

๏Comparison of max and min temperature readings

๏Comparison of air quality of each station in the past week

๏Show all air quality sensors within certain distance from a location

๏Show all air quality sensors that are NOT within a polygon

Page 11: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Why build your IoT application with open standards?

Future Proof and Proven Working

Leverage years of R&D efforts for FREE!!

Page 12: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Today we will use SensorUp’s air quality monitoring system in Calgary as an example.

http://example.sensorup.com/v1.0

Page 13: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

What do you need?

Any text editor

A modern browser (Chrome in this webinar)

A JSON viewer plugin (JSONView in this webinar)

Page 14: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

GitHub

https://github.com/SensorUp/Webinars

Page 15: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

IMPORTANT

We are using Highstock.js today. Highstock/Highchart is open source and free for non-commercial uses. But it is NOT free for commercial uses.

Page 16: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Acknowledgement

Thanks to Mariam Dost for preparing today’s tutorials’ source codes.

Page 17: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

The data model

AirBox

The Air in My Backyard

• Plant Tower G3 • DHT22

• Particulate Matter 2.5 • Relative Humidity • Air Temperature

My Backyard

Page 18: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Analytics Steps (Data Mining Steps)1.Data Cleaning

2.Data Integration

3.Data Selection

4.Data Transformation

5.Data Mining

6.Pattern Evaluation

7.Knowledge Presentation

OGC SensorThings API

Page 19: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#1: Percentage of Good, Moderate and Unhealthy Air Quality Readings

Page 20: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#1: Percentage of Good, Moderate and Unhealthy Air Quality Readings

# of Good Results# of All Results

# of Moderate Results# of Unhealthy Results

Page 21: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

EPA Air Quality Index

Page 22: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Get the number of “unhealthy” readings, i.e., greater than or equal to 35.5, from SensorThings API

http://example.sensorup.com/v1.0/Datastreams(3505)/Observations?$filter=result ge 35.5

http://example.sensorup.com/v1.0/Datastreams(3505)/Observations?$filter=result gt 35.5&$top=1

Page 23: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Get the number of “modest” readings, i.e., between 13 and 35.5, from SensorThings APIhttp://example.sensorup.com/v1.0/Datastreams(3505)/Observations?$filter=result lt 35.5 and result ge 13&$top=1

Page 24: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Pie Chart of Air Quality Readings

Page 25: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#2: Daily max and min temperature of the past week

Page 26: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Get a day’s maximum result value

http://example.sensorup.com/v1.0/Datastreams(4207)/Observations?$filter=day(phenomenonTime) eq 16 and month(phenomenonTime) eq 8

1. Get the Observations on August 16

Page 27: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Get a day’s maximum result value

http://example.sensorup.com/v1.0/Datastreams(4207)/Observations?$filter=day(phenomenonTime) eq 16 and month(phenomenonTime) eq 8&$orderby=result desc&$top=1&$select=result,phenomenonTime

2. Get the Observation with the largest result value on August 16

Page 28: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Get a day’s minimum result value

http://example.sensorup.com/v1.0/Datastreams(4207)/Observations?$filter=day(phenomenonTime) eq 16 and month(phenomenonTime) eq 8&$orderby=result asc&$top=1&$select=result,phenomenonTime

Get the Observation with the smallest result value on August 16

Page 29: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

A different chart of the daily max and min temperature of the past week

Page 30: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#3 Plot the worst air quality of each station in the past week

1. Get a list of the air quality Datastreams

Page 31: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#3 Plot the worst air quality of each station in the past week

2. Get the worst air quality result from each Datastream

Page 32: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#4 Find all air quality sensors within certain distance from a location

Page 33: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#4 Find all air quality sensors within certain distance from a location

$filter=(geo.distance(location, geography’POINT(-114.00+50.99)’) lt 10000)&$orderby=id desc

click here for an example

Page 34: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#4 Find all air quality sensors within certain distance from a location

Page 35: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#5: Find all sensors that are outside of a polygon

Page 36: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

#5: Find all sensors that are outside of a polygon

$filter=st_disjoint(location, geography'POLYGON ((…))’)&$orderby=id desc

Page 37: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

GitHub

https://github.com/SensorUp/Webinars

Page 38: Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API

Next Week

Build Interoperable Smart City Applications Effortlessly