The project analyzes MOD14A1 V6.1 data, providing composite daily fire masks at a 1 km resolution based on MODIS emissions. The fire detection strategy combines absolute detection (detecting when the fire's strength is sufficient) and relative detection concerning its background (considering surface temperature variability and sunlight reflection). The information is utilized for monitoring the spatial and temporal distribution of fires in diverse ecosystems, detecting changes in fire spread, and identifying new fire boundaries, forest fires, and variations in fire frequency or relative strength.
- Earth Engine Python API
- geemap
- imageio
- Pillow
Clone the repository
$ git clone https://github.com/open-data-kazakhstan/fire-detection.git
Requires Python 3.12.0
Package for interactive geospatial analysis and visualization using Google Earth Engine.
pip install geemap
Library that provides an easy interface to read and write a wide range of image data, including animated images, volumetric data, and scientific formats.
pip install imageo
Python image library
pip install Pillow
Ensure authentication and initialization of the Earth Engine Python API:
import ee
import geemap
# Authentication and Earth Engine initialization
ee.Initialize()
Load Kazakhstan boundaries:
kazakhstan = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017') \
.filter(ee.Filter.eq('country_na', 'Kazakhstan'))
Define functions for obtaining image IDs and generating mosaics:
def get_image_ids(collection):
image_ids = collection.aggregate_array('system:index')
return image_ids
def generate_mosaic(year):
# ... (see code for more details)
Create mosaics for each year:
# Iterating over years and generating mosaics
for year in range(2000, 2022):
generate_mosaic(year)
main.py
- main program scriptanimation.py
- script for video animation
Satellite data taken from https://developers.google.com/earth-engine/datasets. Data in the form of PNG images for animation is stored in the βdataβ folder.
Display mosaics on an interactive map using geemap:
Map = geemap.Map()
Map.centerObject(kazakhstan, 4)
Map.setCenter(65.5, 47, 4) # Adjusting the map center
Map.addLayer(kazakhstan, {}, 'Kazakhstan') # Adding Kazakhstan boundaries to the map
# Iterating over years and adding mosaic layers to the map
for year in range(2000, 2023):
generate_mosaic(year)
Map.addLayerControl() # Adding a layer control element to the map
Map
- Change the font path, size and position.
- Select the appropriate images (specify the path to the images).
- Run the script to create the animation.
- Save the animation in MP4 format.
MOD14A1.061: Terra Thermal Anomalies & Fire Daily Global.
The script utilizes MODIS Land Surface Temperature data to generate yearly mosaics. Mosaics are displayed on an interactive map for visual exploration. You can customize the script to choose specific images for map display or comment out the block for saving mosaic images to speed up loading.
Original code by [Edward_Schiller]
MODIS MOD14A1.061 data source: [[Google EE] https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD14A1]
This dataset is licensed under the Open Data Commons [Public Domain and Dedication License][pddl]. [pddl]: https://www.opendatacommons.org/licenses/pddl/1-0/