SensorThings API Webinar - #2 of 4 - IoT Data Modeling with Open Standards
Analyze Your Smart City: Build Sensor Analytics with OGC SensorThings API
Transcript of 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
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
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
News - SensorThings API Press Release
News - OGC SensorThings High-Chart and Data-Table (HCDT) Library
http://www.sensorup.com/sensorthings-high-chart-and-data-table-hcdt/
News - Calgary air quality update
News - Calgary air quality update
Useful Resources
Step #1: SensorThings Playground
http://pg.sensorup.com
Step #2: SensorThings Scratchpad
http://scratchpad.sensorup.com
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
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
Why build your IoT application with open standards?
Future Proof and Proven Working
Leverage years of R&D efforts for FREE!!
Today we will use SensorUp’s air quality monitoring system in Calgary as an example.
http://example.sensorup.com/v1.0
What do you need?
Any text editor
A modern browser (Chrome in this webinar)
A JSON viewer plugin (JSONView in this webinar)
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.
Acknowledgement
Thanks to Mariam Dost for preparing today’s tutorials’ source codes.
The data model
AirBox
The Air in My Backyard
• Plant Tower G3 • DHT22
• Particulate Matter 2.5 • Relative Humidity • Air Temperature
My Backyard
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
#1: Percentage of Good, Moderate and Unhealthy Air Quality Readings
#1: Percentage of Good, Moderate and Unhealthy Air Quality Readings
# of Good Results# of All Results
# of Moderate Results# of Unhealthy Results
EPA Air Quality Index
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
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
Pie Chart of Air Quality Readings
#2: Daily max and min temperature of the past week
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
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
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
A different chart of the daily max and min temperature of the past week
#3 Plot the worst air quality of each station in the past week
1. Get a list of the air quality Datastreams
#3 Plot the worst air quality of each station in the past week
2. Get the worst air quality result from each Datastream
#4 Find all air quality sensors within certain distance from a location
#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
#4 Find all air quality sensors within certain distance from a location
#5: Find all sensors that are outside of a polygon
#5: Find all sensors that are outside of a polygon
$filter=st_disjoint(location, geography'POLYGON ((…))’)&$orderby=id desc
Next Week
Build Interoperable Smart City Applications Effortlessly