Skip to content
GitHub Copilot is now available for free. Learn more

Artwork: Ariel Davis

How Global Forest Watch uses open source to fight deforestation

Global Forest Watch uses open source to turn satellite imagery into actionable insight to save forests.

Klint Finley // April 21, 2021

The ReadME Project amplifies the voices of the open source community: the maintainers, developers, and teams whose contributions move the world forward every day.

The Maya Forest is the second-largest continuous rainforest in Latin America after the Amazon. And like so many other tropical forests around the world, it’s disappearing.

Since 2000, the forest has shrunk by 15%. The good news is that there’s still a lot of forest left: the Maya Forest spans 35 million hectares of land sprawling across Belize, Guatemala, and southeastern Mexico. However, the size of the forest also makes it difficult for any one government agency or NGO to protect.

It’s hard to overstate how important forests are. They’re a critical part of mitigating climate change, developing new medicines, and protecting biodiversity—and a vital source of employment for millions of people. We lost 4.2 million hectares of primary rainforest tree cover in 2020 according to data from the University of Maryland—about the landmass of The Netherlands and 12% more than we lost in 2019. These staggering losses make protecting the vast amounts of forest that remain so important.

That’s why the Mexican conservation group Pronatura Península de Yucatán is tapping the power of satellite imagery and open source software to fight deforestation.

Global Forest Watch is an open source platform that uses satellite imagery and other data sources to give governments and NGOs the ability to monitor forests around the world. It’s stewarded by the World Resource Institute (WRI) in partnership with many other organizations, including Google, USAID, University of Maryland, Esri, and Vizzuality. Conservationists, governments, journalists, and law enforcement use it to keep tabs on forests and take action in the early stages of a deforestation event to prevent large-scale destruction.

Global Forest Watch interactive map depicting global tree cover loss from 2001 to 2020.

The public-facing side of Global Forest Watch is an interactive map. Anyone can use it to see where forest cover is being gained or lost and explore how different forests are used. It also sends deforestation notifications, fire alerts, and more.

Pronatura built on Global Forest Watch’s open source code to create its own regional application, Maya Forest Watch. By building on existing software, the organization was able to spend less time and fewer resources building their app and, instead, shift their focus to training local farmers to use the tool to track forest fires.

Wildfires account for about 11% of deforestation in the Maya Forest. About 80% of fires there are planned agricultural burns. But when these go awry, they can spread to the surrounding land and threaten a vital part of the local economy. Maya Forest Watch helps farmers monitor fires and, when an unexpected one breaks out, rally fire brigades to contain blazes that could have become much larger had they not been spotted early.

“Global Forest Watch is very user-friendly and works well on smartphones,” says Efraim Acosta, Project Manager for Pronatura. “That’s important because our local partners don’t often have much experience with technology. Most don’t have laptops, but everyone has a smartphone.“

Behind Global Forest Watch’s interface is a powerful and complex technology stack. The backend is built mostly on PostGRESQL/PostGIS and the Python framework FastAPI along with data tools like pydantic, GINO, the GDAL library, Proj4, and GEOS. The project also uses Apache Spark for much of its batch processing. The front-end, meanwhile, is built on React, Redux, and Next.js.

“We are highly dependent on the open source frameworks and libraries developed by the community,” Global Forest Watch Engineering Lead Thomas Maschler says. “There is so much innovation coming out of open source software. We tend to be on the early adopter side when it comes to tools and frameworks and we wouldn’t be able to move at the same speed if we would work with proprietary software.”

Seeds of change

WRI had been publishing deforestation maps under the Global Forest Watch banner since the 1990s. But these early maps weren’t as detailed or updated as rapidly as today’s interactive web application is. In addition to up-to-date satellite imagery, a deforestation monitoring system needs to distinguish between a significant loss of forest cover and the natural changes forests experience as seasons shift. Global Forest Watch ingests data from NASA’s Landsat, ESA’s Sentinel satellites, and other sources and analyzes it all for signs of forest loss. This requires more computing power than WRI had access to in the 1990s.

“Only when cloud computing became widely accessible could we start doing what we do now,” Maschler says. The first iteration of the new Global Forest Watch processed 20 terapixels of Landsat data, using one million CPU-core hours on 10,000 computers in parallel.

Rangers with the Uganda Wildlife Authority use the Forest Watcher app to identify illegal deforestation in Kibale National Park, which has one of the highest concentration of primates in Africa.

The seeds of the modern version of Global Forest Watch were planted in 2009 by Dan Hammer, Robin Kraft, and David Wheeler while working for the Center for Global Development. There they created a prototype of a remote monitoring system dubbed FORMA (FORest Monitoring for Action). The system was further refined and updated first monthly and then daily by the WRI Data Lab after the group joined WRI in 2014.

The final breakthrough came in 2013 with the development of a global high resolution dataset on tree cover loss by the GLAD Lab at the University of Maryland. The dataset, which was developed in partnership with Google Earth Engine, helped create the foundation for a new version of Global Forest Watch.

The platform’s software was open source from the beginning—all the code required to build it is available on GitHub. Organizations can use it to create custom forest monitoring systems, as Pronatura has done, or to fork the system and use it for other types of geospatial data.

Maschler says the project always welcomes bug fixes and other contributions. But because its needs tend to be so specific, he says developers looking to lend a hand could also consider contributing to the various open source projects that make Global Forest Watch possible, such as FastAPI, pydantic, GINO, Rasterio, or NumPy.

Likewise, the Global Forest Watch team contributes to their upstream projects, for example by adding new features to FastAPI, such as the ability to declare metadata tags using the OpenAPI standard.

It’s hard to quantify how much forest has been saved thanks to Global Forest Watch, especially given that deforestation is an ongoing and accelerating problem. But the WRI found an 18% decrease of the probability of deforestation in areas across Africa where users subscribe to near real-time alerts. As awareness of the system increases—and as governments prioritize saving forests—the project could help save even more forest cover around the world.

A clearing in the Republic of Congo as seen by a drone.

That situation changed earlier this year. Thanks to the European Space Agency’s Sentinel-1 satellites, Global Forest Watch is now able to collect radar data. The longer wavelengths of radar waves are able to penetrate cloud cover, enabling imaging under cloudy, foggy, or smoky conditions. “We used to get data from some parts of the world only a couple times a year,” Maschler says. “Now we have updates every two weeks.”

This continuous improvement is crucial because of the challenges to come. Climate change exacerbates the causes of deforestation, and deforestation contributes to climate change, creating a vicious cycle. We need tools like Global Forest Watch—and the open source ecosystem around it—to break out of this cycle.

About The
ReadME Project

Coding is usually seen as a solitary activity, but it’s actually the world’s largest community effort led by open source maintainers, contributors, and teams. These unsung heroes put in long hours to build software, fix issues, field questions, and manage communities.

The ReadME Project is part of GitHub’s ongoing effort to amplify the voices of the developer community. It’s an evolving space to engage with the community and explore the stories, challenges, technology, and culture that surround the world of open source.

Follow us:

Nominate a developer

Nominate inspiring developers and projects you think we should feature in The ReadME Project.

Support the community

Recognize developers working behind the scenes and help open source projects get the resources they need.

Thank you! for subscribing