The COVID Schools Canada project is a volunteer effort by grassroots group Masks4Canada to compile data on COVID-19 cases and outbreaks in schools across Canada. Their mission is to keep students, parents, teachers, and officials well-informed and ”provide transparency on the full impact of COVID-19 on schools and communities, and advocate for safe school policies,” explains team lead Shraddha Pai.
After reading Shraddha’s engaging Twitter thread about the project, I connected with her to hear the story behind building COVID Schools Canada.
Scaling for national COVID data
Masks4Canada has been advocating for evidence-based public health policy and safe school policies since the COVID-19 pandemic began. In response to a lack of transparency from multiple Provincial governments, the group decided to create a tracker to collect more complete data on how COVID-19 was impacting schools. It quickly grew to a scale that was challenging to maintain, with volunteers needing to manually add new points to their map every day.
“We started with Google My Maps because it was easy to get started. But as the project scaled up and our data grew it became difficult to manage. We were running into the maximum number of points per layer. And the map was getting cluttered because we couldn’t include logic, like filtering by recency.” - Shraddha Pai, Masks4Canada
When they could no longer add additional points, Shraddha and Masks4Canada reached out to their Twitter followers to ask for alternative mapping solutions and connected with the Mapbox Community team.
Joining the Mapbox Community
To help the COVID Schools Canada team transition their project to Mapbox, Community Team program manager Megan Danielson drafted an initial prototype of the map using the Sheet Mapper impact tool and then onboarded the team to map styling and Mapbox GL JS in a live Zoom session. Using Mapbox tutorials and code examples, and with remote support from Megan, the team was able to launch their new map in early 2021.
“We tried to originally go via Google for Non-Profits to stay with Google Maps ecosystem, but as we are not a registered non-profit we didn't have any paperwork to support our application. On the other hand, Mapbox offers a generous free tier with 50K pulls a month and 20K geocode calls. More importantly, they offered a human being to guide us in jump-starting our map. That support really helps with adoption.” - Shraddha Pai, Masks4Canada
The new COVID Schools Canada site pulls data from multiple Google sheets containing geocoded school locations and COVID data, cleans the data, converts it to GeoJSON using csv2geojson, and then loads and styles it onto a web map using Mapbox GL JS, all hosted on a Github Page. The map updates live from the GeoJSON file every time it loads, visualizing the data with data-driven styling rules for circle size and color. Users can also filter the map to display a maximum or minimum of cases or within a particular date range.
“Setting up Mapbox was fun. Cool API, many examples online, large user base. They even have a plugin to pipe directly from a Google sheet. CSV > geojson > github > boom!” - Shraddha Pai, Masks4Canada
A user-friendly data pipeline
On the backend, the Masks4Canada team uses a series of two-sheet Google Sheets workbooks, one for each Province. The first sheet is a list of all schools in the Province and their corresponding latitude and longitude coordinates, generated using the Mapbox permanent geocoding API. The second sheet is the COVID-19 case data with one record per school and a LOOKUP formula that pulls in its corresponding location coordinates from the first sheet.