#BuiltWithHERE

“Air quality aware” bike routes with HERE APIs

By Mohini Todkari | 18 May 2022

Try HERE Maps

Create a free API key to build location-aware apps and services.

Get Started

What if you had a way to compare air quality during route planning and could choose the route with the best Air Quality Index (AQI) on a given day?

Air quality of a place is based on number of pollutants in the air such as smoke, dust, dirt, soot, and salt. These pollutants are released from vehicles, factories, fires, and any other natural or human activity. We can easily check the daily AQI at the city level and plan activities. Let's look into how Anders Elias, a Swedish data engineer, calculates AQI at the route level using HERE APIs.

"Built with HERE" is a series that showcases how developers are using the HERE platform to solve location related business problems. Each post highlights developer solutions and apps that are timely, innovative and transformative. 

 

Background

Anders Elias works as a Data Strategist in the public sector. In his spare time, he likes to create showcases for open data, open-source, and maps. He came across a newly developed Air Quality API from the City of Stockholm’s Environmental Management Department. He thought this would be a perfect match with HERE Routing ServicesBicycle Routing, to find “air quality aware” routes for bicyclists. This would allow users (bicyclists, e-scooters users etc.) to choose a route that, at any given time of day, minimizes the dose inhaled air pollution. Even if a route is longer, it may be a better choice, when taking air pollution into account. The API provides Air Quality Data and forecasts for Stockholm, Sweden.

 

"Even if a route is longer, it may be a better choice, when taking air pollution into account." - Anders Elias, Data Strategist

 

Asthmatics, children, and elderly are particularly vulnerable to poor air quality. With the City of Stockholm’s AQI API, they hope that Stockholmers will use the forecasting system to plan activities, or even asthma medication, based on information about when and where the air quality is worse.

 

Methodology

Anders is iteratively developing this project using R, the programming language for data science. He was looking for a robust, high-quality, and affordable routing API with rich functionalities such as isolines, isochrones, poi’s etc. He found an R interface to the HERE REST APIs (hereR package) on Twitter. 

 

“I found HERE APIs to be exactly what I needed, in terms of high data quality, robust and clear architecture, interfaces in R and Python, good documentation and support and a generous freemium plan for developers.” - Anders

 

The Air Quality model and API are developed by SLB-Analys, a part of the City of Stockholm’s Environmental Management Department (Environmental Services) and is open data (CC0).

The forecasting model is based on a numerical model that calculates air pollution forecasts for the coming 72 hours. The target area for the Gaussian model is a 35x35 km area, covering Stockholm, Sweden. The geographical resolution is 100x100 m. The model takes input data from Copernicus Atmosphere Monitoring Service (CAMS) Global atmospheric composition forecasts, Swedish Meteorological and Hydrological Institute (SMHI) and others. 

routes

In this app, Anders calculates the estimated multi-pollutant Air Quality Health Index (AQHI) for the routes from the high-resolution grid, for any given point in time. The AQHI of the current hour and the coming 72 hours are calculated from the sum of the percentage risk index for four criteria air pollutants: ozone (O3), nitrogen (NOx), birch pollen and particulate matter (PM10); and then visualized on the app.

 

What's next?

Anders plans to get feedback from air quality and air pollution experts within the organization that developed the Air Quality API. He plans to complete this project in 2022, and we certainly look forward to the finished project. I am selfishly interested to see this implemented for Los Angeles. Anyone up for the challenge?

Leave a comment or reach us on Twitter at @heredev. Don't hesitate to get started today!