Making Open Weather Data More Accessible: Extracting Seasonal Insights from Singapore Weather Station Data

A presentation at Open Up Global Summit 2019 in December 2019 in Taipei, Taiwan by Ong Chin Hwee

Slide 1

Slide 1

Making Open Weather Data More Accessible: Extracting Seasonal Insights from Singapore Weather Station Data Presented by: Ong Chin Hwee (@ongchinhwee) 1 December 2019

Slide 2

Slide 2

About me Ong Chin Hwee 王敬惠 ● Data Engineer @ ST Engineering ● Background in aerospace engineering + computational modelling ● Loves (and contributes to) pandas ● Mentor team at BigDataX, one of the Top 10 Data Communities in Singapore @ongchinhwee

Slide 3

Slide 3

Singapore 新加坡: 1°17’22.81”N, 103°51’0.25”E 北纬1度,经纬103度 @ongchinhwee

Slide 4

Slide 4

105° 0° @ongchinhwee

Slide 5

Slide 5

A year is usually split into four seasons… 常說一年划分为四季。。。 @ongchinhwee

Slide 6

Slide 6

春 Spring @ongchinhwee

Slide 7

Slide 7

春 Spring 夏 Summer @ongchinhwee

Slide 8

Slide 8

春 Spring 夏 Summer 秋 Autumn @ongchinhwee

Slide 9

Slide 9

春 Spring 夏 Summer 秋 Autumn 冬 Winter @ongchinhwee

Slide 10

Slide 10

…how about my home country? 。。。新加坡有多少季節? @ongchinhwee

Slide 11

Slide 11

Are the “four seasons” just… @ongchinhwee

Slide 12

Slide 12

Are the “four seasons” just… 1. Hot 熱 2. Very Hot 很熱 3. Extremely Hot 超熱 4. Rain? 雨 @ongchinhwee

Slide 13

Slide 13

Slide 14

Slide 14

Let’s discover seasons through data. 讓我們以數據來發掘季節。 @ongchinhwee

Slide 15

Slide 15

Extracting Weather Data @ongchinhwee

Slide 16

Slide 16

Data.gov.sg - Singapore’s Open Data Portal 新加坡開源數據平台 @ongchinhwee

Slide 17

Slide 17

Realtime Weather Readings across Singapore Real-time API (Application Programming Interface) on Data.gov.sg (Singapore’s open data portal) 即時應用程式介面 @ongchinhwee

Slide 18

Slide 18

Realtime Weather Readings across Singapore Real-time API on Data.gov.sg (Singapore’s open data portal) Open government data available under the Singapore Open Data License 政府開放資料 @ongchinhwee

Slide 19

Slide 19

Realtime Weather Readings across Singapore Real-time API on Data.gov.sg (Singapore’s open data portal) Open government data available under the Singapore Open Data License Minute-by-minute weather station readings @ongchinhwee

Slide 20

Slide 20

“Let’s try to scrap weather data for a specific weather station!” @ongchinhwee

Slide 21

Slide 21

“Let’s try to scrap weather data for a specific weather station!” “How about we scrap month-long data from the API?” @ongchinhwee

Slide 22

Slide 22

@ongchinhwee

Slide 23

Slide 23

@ongchinhwee

Slide 24

Slide 24

@ongchinhwee

Slide 25

Slide 25

Nested JSON format! @ongchinhwee

Slide 26

Slide 26

@ongchinhwee

Slide 27

Slide 27

😰 @ongchinhwee

Slide 28

Slide 28

Open Data = Available 開放資料 = 任何人都能取得 @ongchinhwee

Slide 29

Slide 29

Open Data = Accessible? 開放資料 = 任何人都能使用? @ongchinhwee

Slide 30

Slide 30

“The data must be available as a whole and at no more than a reasonable reproduction cost…The data must also be available in a convenient and modifiable form.” - Open Knowledge Foundation @ongchinhwee

Slide 31

Slide 31

Open Data - Available, Readable, Accessible Available: Open data is freely available for everyone to access and use without restrictions or exorbitant costs. @ongchinhwee

Slide 32

Slide 32

Open Data - Available, Readable, Accessible Available: Open data is freely available for everyone to access and use without restrictions or exorbitant costs. Readable: Open data is more usable when it is shared in a machine-readable format such as JSON @ongchinhwee

Slide 33

Slide 33

Open Data - Available, Readable, Accessible Available: Open data is freely available for everyone to access and use without restrictions or exorbitant costs. Readable: Open data is more usable when it is shared in a machine-readable format such as JSON Accessible: Open data is only useful if it’s shared in a way that everyone can easily discover and understand. @ongchinhwee

Slide 34

Slide 34

If not everyone can understand how to use the available data, is the data really open? @ongchinhwee

Slide 35

Slide 35

💭 @ongchinhwee

Slide 36

Slide 36

💡 @ongchinhwee

Slide 37

Slide 37

I ended up creating my own scraping tool. @ongchinhwee

Slide 38

Slide 38

“Scraping Meteorological Data from Data.gov.sg APIs” Project @ongchinhwee

Slide 39

Slide 39

Data.gov.sg Weather Data API Scraping Scraping weather data from APIs via Python “Requests” library “Requests”: Python library for humans to send HTTP requests @ongchinhwee

Slide 40

Slide 40

Data.gov.sg Weather Data API Scraping Scraping weather data from APIs via Python “Requests” library Currently supported Data.gov.sg APIs: 1. Air Temperature (in degree Celsius) — 17 Weather Stations 2. Rainfall (in mm) — 53 Weather Stations @ongchinhwee

Slide 41

Slide 41

Data.gov.sg Weather Data API Scraping Scraping weather data from APIs via Python “Requests” library Currently supported Data.gov.sg APIs: 1. Air Temperature (in degree Celsius) 2. Rainfall (in mm) Scrap data for continuous time range + specific weather station @ongchinhwee

Slide 42

Slide 42

API Scraping Demo @ongchinhwee

Slide 43

Slide 43

Singapore’s Weather Station Positions (Source: Weather.gov.sg) 新加坡气象站位置 @ongchinhwee

Slide 44

Slide 44

Time Series Analysis of Singapore Weather Station Data Selected weather station: Changi Weather Station (ID: S24) Analysis timeframe: 2 Dec 2016 to 30 Nov 2019 (~3 years) Objective: - Extract trend and seasonality from minute-by-minute weather time series @ongchinhwee

Slide 45

Slide 45

Time Series Analysis Demo @ongchinhwee

Slide 46

Slide 46

Key Takeaways 1. Open data needs to be accessible to anyone to be useful. ○ Putting data out on the web with open data license is usually not enough - it’s not just developers using open data! @ongchinhwee

Slide 47

Slide 47

Key Takeaways 1. Open data needs to be accessible to anyone to be useful. ○ Putting data out on the web with open data license is usually not enough - it’s not just developers using open data! 2. If an open data source is not intuitive enough to use, build a tool to make the data more accessible for everyone! @ongchinhwee

Slide 48

Slide 48

Reach out to me! And check out my project on: : ongchinhwee : @ongchinhwee : hweecat https://ongchinhwee.me hweecat/api-scraping-nea-datasets @ongchinhwee