Google Earth Engine Tutorial: Detect Wildfires and Vegetation Changes
Credit: Youtube Channel “Terra Spatial, Tutorial on wildfire detection and vegetation change mapping using VIIRS and Landsat 8 imagery.”
You can see all the tutorials from here: Techgeo Academy.
Google Earth Engine Tutorial: Detect Wildfires and Vegetation Changes
Google Earth Engine (GEE) is a powerful platform for analyzing geospatial data. This tutorial demonstrates how to detect wildfires and monitor vegetation changes using GEE’s tools and datasets. Follow these steps to leverage the platform for environmental monitoring and disaster response.
Step 1: Set Up Your GEE Project
Before starting, ensure you have a GEE account and access to the Code Editor. Familiarize yourself with the JavaScript API, as it is the primary language used in GEE for data processing. Load the necessary libraries, such as ee
, and initialize your project.
Step 2: Access and Filter Fire Detection Data
GEE provides datasets like the MODIS Active Fire Detection
(MOD14A1) and VIIRS Fire Detection
(VNP14A1). Use the filterBounds
and filterDate
methods to narrow data to your region of interest and time frame. For example:
var dataset = ee.ImageCollection('MODIS/061/MOD14A1')
.filterDate('2022-01-01', '2022-12-31')
.filter(ee.Filter.eq('instrument', 'MODIS'));
Step 3: Identify Wildfires Using Algorithms
Wildfires are often marked by high thermal anomalies. Extract the fire confidence layer and threshold it to identify potential fire pixels. Use the bitwiseExtract
function for this purpose:
var fires = dataset.select('QF_FIRE')
.map(function(image) {
return image.bitwiseExtract(1).eq(1).rename('fire');
});
Visualize the results with Map.addLayer
and adjust the color palette to highlight fire hotspots.
Step 4: Analyze Vegetation Changes
To detect vegetation loss or recovery, use the Normalized Difference Vegetation Index (NDVI)
. Access Landsat 8 surface reflectance data (LANDSAT/LC08/C02/T1_L2) and calculate NDVI as follows:
var landsat = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
.filterDate('2022-01-01', '2022-12-31');
var ndvi = landsat.select(['SR_B7', 'SR_B4']).map(function(image) {
return image.addBands(image.normalizedDifference(['SR_B4', 'SR_B7']).rename('NDVI'));
});
Compare NDVI values before and after a fire event to assess vegetation impact.
Step 5: Time Series Analysis and Visualization
Create time series charts to track fire occurrences and vegetation changes over time. Use chart.image.series
to display trends and identify patterns:
var timeSeries = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
.filter(ee.Filter.eq('WRS_PATH', 31))
.filterDate('2020-01-01', '2022-12-31');
var chart = ui.Chart.image.series(timeSeries, 'NDVI', geometry, 500);
chart.setChartType('LineChart');
chart.setOptions({title: 'Vegetation Change Over Time'});
print(chart);
Step 6: Export Results for Further Analysis
Use Export.image.toDrive
or Export.image.toCloudStorage
to save outputs like fire maps or vegetation indices. Ensure you specify export parameters such as scale, region, and file format.
FAQ
What datasets are commonly used for wildfire detection in GEE?
MODIS and VIIRS fire detection datasets are widely used, along with Landsat for vegetation analysis. These datasets provide thermal anomalies and spectral information to identify and monitor fires.
How accurate is wildfire detection using GEE?
Accuracy depends on data resolution, sensor sensitivity, and algorithm thresholds. High-resolution datasets like VIIRS improve precision, while MODIS offers broader coverage with lower resolution.
Can GEE analyze historical wildfire data?
Yes, GEE provides access to historical datasets dating back to the early 2000s. These can be used to study long-term patterns and trends in wildfire occurrences.
What tools does GEE offer for vegetation change analysis?
GEE supports NDVI, EVI (Enhanced Vegetation Index), and other vegetation indices. Time series analysis and machine learning tools like ee.Classifier
can also be used to detect changes in land cover.
Is GEE free to use for environmental monitoring?
GEE is free for academic and research purposes. For commercial use, a GEE Pro Plan is required, which provides increased computational resources and access to additional datasets.
How long does it take to process wildfire data in GEE?
Processing time varies depending on data volume and computational complexity. Simple queries are often instant, while large-scale analyses may take minutes or hours. GEE handles distributed computing, ensuring efficiency even with big datasets.