integration · laravel · vue · 2021
Satellite fire detections, alerted automatically
DMH/DINAC, Paraguay, with WWF Paraguay
A public platform that pulls fire detections from four NASA satellites, matches them against areas people have drawn on a map, and emails only the people whose land is affected.
The operation
Paraguay's national meteorology and hydrology directorate (DMH/DINAC), working with WWF Paraguay, needed the public, government officials and conservation organizations to be able to see where the country was burning, in near real time, without asking anyone.
The result runs at focoscalor.meteorologia.gov.py: an interactive map carrying more than thirty toggleable layers, covering fire detections from four satellite instruments, fire risk forecasts, weather model output, and administrative and environmental reference data.
The part that was actually hard
Not the map. The alerting.
A subscriber marks the area they care about, either by drawing it straight onto the map or uploading a boundary they already have. Every hour, the system has to intersect incoming fire detections against hundreds of those polygons and email only the people whose area was actually hit, and only about detections they have not already been told about.
That last constraint is what makes it difficult. The four satellite instruments report at different times of day, so the system has to remember separately, for every satellite and every subscriber, exactly what that person has already been told about. Get that wrong and people either get told twice or never get told at all, and an alerting system nobody trusts is worse than no alerting system.
The four instruments also disagree with each other. They can see the same fire and describe it differently: one reports how sure it is as a number, another as a word, and each names its files its own way. Somebody has to decide what those mean side by side before a landowner can be told their property is burning, and that decision has to come out the same way every hour, indefinitely, with nobody checking it.
The build
At six every morning, Paraguay time, a report arrives in inboxes that nobody made. It counts the previous day's detections by department, pulls the next seventy-two hours from the directorate's own weather model, lays it out as a branded PDF and sends it. Nobody logs in, nobody exports anything, and nobody has to remember.
Behind the map sit four organisations that have never coordinated with one another: NASA for the satellite detections, the directorate's own systems for the geography, Brazil's INPE for fire risk, and the European Commission for the fire weather index. Keeping one public map honest means keeping four separate arrangements working at the same time, every hour, without anyone noticing the work.
Where it stands
Built in 2021 and maintained for about three and a half years. Several of those commits exist because NASA changed the FIRMS API underneath it. That is the honest shape of a system that depends on someone else's data: staying up is work, not a one-time delivery.
Different business, same shape of problem?
Every system written up here started with somebody describing an operation that had outgrown the way it was being run. If that sounded familiar, tell me how yours works today.
Talk through your version