Google Earth Engine Tutorial: Analyze LST and Vegetation Dynamics
Credit: Youtube Channel “Terra Spatial, Comprehensive spatio-temporal analysis of land surface temperature and vegetation dynamics using Landsat-8.”
You can see all the tutorials from here: Techgeo Academy.
Google Earth Engine (GEE) is a powerful platform for geospatial analysis, enabling researchers and GIS professionals to process large-scale Earth observation data efficiently. One common application is analyzing Land Surface Temperature (LST) and vegetation dynamics to understand environmental changes, urban heat islands, or agricultural impacts. This tutorial demonstrates how to use GEE for this task with Python API.
Data Preparation
Begin by importing the required datasets. For LST, MODIS or Landsat datasets are commonly used. For vegetation analysis, Landsatโs near-infrared (NIR) and red bands are essential for calculating the Normalized Difference Vegetation Index (NDVI).
import ee
ee.Authenticate()
ee.Initialize()
# Load MODIS LST dataset
lst_dataset = ee.ImageCollection("MODIS/006/MOD11A1")
# Load Landsat 8 surface reflectance data
landsat = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")Land Surface Temperature (LST) Calculation
LST is derived from thermal infrared bands. For MODIS, use the emissivity and surface temperature bands. Scale the values and clip to a region of interest.
def calculate_lst(image):
lst = image.select(['LST_Day_1km']).multiply(0.02).add(273.15)
return lst.clip(roi) # roi is your defined region of interestVegetation Index Calculation
Calculate NDVI using Landsat bands. This helps quantify vegetation health and density.
def calculate_ndvi(image):
ndvi = image.normalizedDifference(['SR_B4', 'SR_B5']).rename('NDVI')
return ndvi.clip(roi)Data Analysis
Combine LST and NDVI data for time series analysis or correlation studies. For instance, analyze how LST changes with vegetation cover over a year.
lst_collection = lst_dataset.map(calculate_lst)
ndvi_collection = landsat.map(calculate_ndvi)
# Create a time series chart
var chart = ui.Chart.image.seriesByRegion({
imageCollection: lst_collection.select('LST_Day_1km'),
regions: roi,
reducer: ee.Reducer.mean(),
scale: 1000,
xProperty: 'system:time_start'
});
print(chart)
// Visualize the relationship between LST and NDVI
var lst_ndvi_chart = ui.Chart.image.series({
imageCollection: ee.ImageCollection([lst_collection, ndvi_collection]),
region: roi,
reducer: ee.Reducer.mean(),
scale: 1000
});
print(lst_ndvi_chart)Visualization
Use GEEโs built-in visualization tools to map LST and NDVI. For example, display LST in a temperature gradient and NDVI as a vegetation index overlay.
Map.setCenter(-99.4, 19.4, 10)
Map.addLayer(lst_collection.select('LST_Day_1km'), {
min: 280, max: 320, palette: ['blue', 'green', 'yellow', 'red']
}, 'LST')
Map.addLayer(ndvi_collection.select('NDVI'), {
min: -1, max: 1, palette: ['brown', 'yellow', 'green']
}, 'NDVI')FAQ
How do I access LST data in Google Earth Engine?
LST data is available in datasets like MODIS/006/MOD11A1 or Landsat thermal bands. Use the appropriate bands and apply scaling factors as provided in the dataset documentation.
What is the best vegetation index for LST analysis?
NDVI is widely used for vegetation dynamics due to its sensitivity to chlorophyll content. However, indices like EVI or SAVI may be more suitable for certain environments.
How long does it take to process a GEE script?
Processing time depends on data volume and computational complexity. For small regions, it may take seconds, while larger areas can require minutes. Use the getRegion() method for sampling if needed.
Can I analyze LST and vegetation in different time periods?
Yes. Filter the image collection by date using filterDate() and compare biannual or seasonal trends.
What if my data has cloud cover issues?
Use cloud masking functions like .where() or select cloud-free data from collections like LANDSAT/LC08/C02/T1_L2 with maskClouds() to ensure accuracy.






