The map on the office TV
Someone dropped a video clip into Slack at Ona's office in Nairobi, and we put it up on the TV in the main room where everyone sat. Bill Gates was onstage at the London Malaria Summit in 2018, talking about Zambia's malaria spraying.
In his keynote, he showed a map of Zambia that zoomed into a single spray area labelled Mat_4. Across the top was the title for the 2017-2018 season, with the name mSpray right there.
I had spent the previous season buried in that codebase, staring at those tables and maps from my desk, and suddenly Bill Gates was showing mSpray in London. In the clip, he called Zambia's approach "very cutting edge". A little later he talked about wanting to "partner with the experts here" on designing and scaling improved surveillance. The room cheered. For a minute, it felt like Bill Gates was talking about us.
If you pause the clip on Mat_4, you see a satellite photo of rural Zambia, with an orange shape drawn around one cluster of buildings and coloured footprints and dots inside. People running a spray campaign opened maps like this to see what crews had finished and where to send them next.
Spray Area Mat_4 on the 2017-2018 mSpray map, 15 seconds into the Gates Foundation's video.
Each dot is a building. Blue means a mapped building nobody has visited yet; the other colours show the status a crew recorded. Dark grey means not eligible. Red means an eligible home a crew reached and couldn't spray. Green means sprayed.
Floating beside Mat_4 was a small tooltip: "Spray Effectiveness: 37%". In mSpray, sprayed buildings against all the eligible buildings in an area was the figure compared with a bar of 90%. For Mat_4, that meant only 37% of the eligible buildings mSpray counted there had been sprayed.
In a malaria spraying campaign, crews go house to house before the rains, spraying insecticide onto the inside walls. They have to cover nearly every house in a community, because mosquitoes rest in the houses that are missed. That is why the bar on mSpray was 90%.
Crews started from a map of the buildings, grouped into clusters called spray areas so a team could work one area at a time and managers could track how far they got. Out in the field, crews carried tablets with that map loaded. On a visit to a building, ODK Collect held the form for recording whether it was eligible and whether it got sprayed, and OpenMapKit tagged the building on the map. If a crew came across an eligible home the map had missed, the app let them add it on the spot.
Mobile signal was patchy or gone across those rural districts, so the form waited on the tablet until there was signal again. Once the tablet connected, it uploaded to Onadata, which sent the submission over a webhook straight into mSpray.
In Zambia, the people waiting on those uploads were the managers at Akros, our partner organisation supporting the mSpray deployments. Once crews got back into signal and uploaded the day's work, the forms arrived together in a rush. Managers at Akros needed complete, accurate numbers that evening to decide where crews went early the next morning. That meant the dashboard had to take a day's burst of uploads, keep the numbers straight, and load over weak connections.
Inside mSpray, those incoming forms drove tables and maps where managers could click from a whole district, through rural health centres, all the way down to a spray area and a single house to see what had been done. The dashboard also tracked how crews and individual operators were getting on from day to day, and pulled those same figures together for campaign reporting.
mSpray was my first assignment when I joined Ona in Nairobi in 2017. The web dashboard had already been running for a few years, built on Django and PostGIS. I wasn't the only engineer on it, but that first season I took the lead on the dashboard work.
Keeping it fast and keeping it right pulled against each other every evening. A full day's submissions would hit in a burst and roll up into district tables, health centres, spray areas, and maps, while managers on the other end were trying to open those screens over weak rural connections. If the numbers went stale or a map dragged on a slow link, the dashboard stopped being useful for the next morning's plan.
Crews started spraying early, so there was no time in the morning to decide where to send them. When something went wrong in the evening, the screen had to be right that night, and fixing it was on me. I stayed on call through the season and joined crisis calls with Akros whenever a spray area wouldn't load, a day's data hadn't turned up, or records had landed in the wrong area and needed moving. For example, about 3,000 records came in with coordinates outside every spray area, and attaching them to the areas named on the forms pulled the local maps so far out that a manager couldn't read them. I took those records off the local maps and gave them a screen of their own, so the maps were readable again.
That season I went to Akros headquarters in Lusaka and sat with management on standby in case anything needed heavy lifting. It was good to meet the people on the other end of those calls. I made a few small fixes from the office, and otherwise there were no incidents to report.
Mat_4 sitting at 37% on that summit map was a familiar problem. Once crews had worked through an area and moved on, managers still had to decide which places were short of that 90% bar and needed a return visit. For about two years, managers at Akros had been pulling numbers out into Excel to build that mop-up list by hand. In the 2018 season, that routine moved inside mSpray: a teammate built a mop-up list straight into the dashboard, and I fixed which areas made the list and made its totals match the rows.
I think we pulled it off nicely. When we put that clip up on the office TV, the map in Bill Gates's keynote had mSpray across the top, the tool we had kept working through all those evenings. That year, TIME also named Ona one of its 50 Genius Companies and highlighted its mapping work.
I can legitimately say that I was part of the team behind mSpray. The dashboard held up for the people running those campaigns, and I am still proud of my part in it.
Working with me
If you have field data you want turned into maps and tables, or a data-heavy dashboard that needs to stay fast and accurate for the people using it, I am available for hire. You can read my resume, look at my code on GitHub, or get in touch through my contact page.
