Android app and widgets for displaying Canadian Air Quality Health Index (AQHI) conditions, forecast and historical readings.
Download and install the latest release.
Note
Both light mode and dark mode are supported and will switch automatically with the system preference.
Tip
Tapping on the heat maps will reveal the raw data values!
Two widgets are provided: a small widget that displays the most recent AQHI reading at your location, and a larger, wider widget that shows the AQHI reading on a relative scale.
Widgets are configurable: you can set the background transparency as well as the light/dark mode. A preview of the widget is shown as you configure it.
Tip
Setting light/dark mode to automatic will make the widget switch automatically with the system preference.
AQHI Data is pulled from Environment and Climate Change Canada's public API using the closest active monitoring station to your current location. The station definitions, current location, and current AQHI readings are all cached to prevent excessive calls to the API. Data is shared between the main app and the widgets.
The rendering of heat maps is entirely written from scratch by myself. My GitHub project contains rendering libraries for both Android and Java2D. Check it out if you want to add beautiful, customizable heat maps to you own Java project.
The Canadian Air Quality Health Index (AQHI) is a made-in-Canada scale developed by Environment and Climate Change Canada (ECCC) to provide real-time information about the health risks associated with air pollution. It combines measurements from ground-level ozone, fine particulate matter (PM2.5), and nitrogen dioxide into a single numerical value on a scale from 1 (low risk) to 10 (high risk). All values above 10 are assigned a reading of 10+, indicating a very high risk.
Scale:
- 1-3 Low health risk
- 4-6 Moderate health risk
- 7-10 High health risk
- 10+ Very high health risk
As per ECCC, the calculation of the AQHI may change over time to reflect new understanding associated with air pollution health effects. AQHI values are calculated automatically using observations from a network of air quality monitoring stations across Canada. These measurements are collected in real-time and are not verified prior to publication. Forecast and historical AQHI values are reported on an hourly basis.
If you are interested in the analysis of Canadian air quality data that has been validated, check out my NAPS Data Analysis Project on GitHub.
For more information about the AQHI, visit ECCC's website.
The typical AQHI is calculated as the median hourly AQHI for the current hour of the day and current week of the year, based on data from your selected location. This calculation uses a 10-year period from 2014 to 2023, where at least 5 years of data are available for that location.
These values were generated using my NAPS Data Analysis Toolbox, which sources raw data from the National Air Pollution Surveillance (NAPS) program, part of Environment and Climate Change Canada. I calculated the tables for the median AQHI from the raw concentration readings of the 3 constituent pollutants (O3, NO2, & PM2.5) for all roughly 300 current active NAPS sites. These sites are then matched to the correct GeoMet stations using a bit of fuzzy logic with the latitude and longitude coordinates that both data sets provide. The formula for calculating AQHI is the following:
The map used for viewing and selecting locations is stored entirely on-device, as I do not want to send your location off-device. The base map data comes from CBCT3978, which is freely provided by Natural Resources Canada under the terms of the Open Government Licence.
The map uses the Lambert Conformal Conic projection, which minimizes distortion across Canada. I cleaned up visible JPEG compression artifacts using a neural filter, then manually stitched together the tiles into a single 1-gigapixel image (35,000 × 30,000 pixels).
This high-resolution map was then tiled into 8 zoom levels and compressed in WebP format. The result is a folder structure containing approximately 21,500 files, taking up only about 160MB of space. The map is diplayed in the app using Pierre Laurence's MapView library. Check out his project!
- This app was developed for and tested on Android 14.
This app is made by David Fortin, an individual - not a corporation. It does not collect or share any of your personal information or data.
Your device's location is used only to identify the closest air quality monitoring station, and only if you explicitly grant the app permission to use location services. Your location information stays exclusively on your device and is never transmitted or shared.
This app determines your nearest air quality monitoring station by comparing your location (locally, on your device) with a list of stations obtained from Environment and Climate Change Canada's (ECCC) GeoMet service. Your location data is never sent to ECCC or any other server.
You can learn more about ECCC's GeoMet service here.
Copyright (c) 2024 David Fortin
This software is provided by David Fortin under the MIT License, meaning you are free to use it however you want, as long as you include the original copyright notice (above) and license notice in any copy you make. You just can't hold me liable in case something goes wrong. License details can be read here