Google Earth Engine Tutorial: Map Urban Heat Islands with MODIS
Credit: Youtube Channel “Terra Spatial, Complete tutorial on mapping urban heat islands using MODIS land surface temperature night imagery.”
You can see all the tutorials from here: Techgeo Academy.
Introduction
Urban Heat Islands (UHIs) occur when urban areas experience significantly higher temperatures than their rural surroundings. Mapping UHIs using satellite data like MODIS (Moderate Resolution Imaging Spectroradiometer) allows for large-scale analysis of temperature patterns. Google Earth Engine (GEE) provides a powerful platform to process and visualize MODIS data. This tutorial walks you through the steps to identify and map UHIs using MODIS Land Surface Temperature (LST) data.
Prerequisites
Before starting, ensure you have access to Google Earth Engine and understand basic JavaScript syntax for GEE. Familiarize yourself with the MODIS LST datasets available in the GEE asset catalog.
Step-by-Step Guide
1. Access Google Earth Engine
Log in to your GEE account at https://earthengine.google.com. Open the Code Editor, and select your script environment.
2. Load MODIS LST Data
Import the MODIS LST dataset using the GEE API. MODIS provides several LST products, such as MOD11A1 (8-day LST) and MOD11C1 (daily LST). Choose the appropriate dataset based on your study area and time frame.
// Load MODIS LST dataset
var lstData = ee.ImageCollection('MODIS/MOD11A1').filterDate('2020-01-01', '2020-12-31');
3. Preprocess the Data
Aggregate the data to create a monthly mean LST map. Use the .mean() function and select the relevant band, typically ''LST_Day_1km'' or ''LST_Night_1km''.
// Select the LST band and reduce to mean
var lstMean = lstData.select('LST_Day_1km').mean();
4. Define the Study Area
Create a geometry representing your urban region and a buffer for comparison. For example, use a polygon of a city and a surrounding rural buffer.
// Define urban area geometry
var urbanArea = ee.Geometry.Rectangle([latMin, lonMin, latMax, lonMax]);
// Create a rural buffer area
var ruralBuffer = urbanArea.buffer(10000);
5. Calculate Temperature Differences
Use the .region() function to extract temperature values within the urban and rural regions. Compare the mean temperatures to identify UHI intensity.
// Extract mean LST for urban and rural areas
var urbanMean = lstMean.reduceRegion(ee.Reducer.mean(), urbanArea, 1000);
var ruralMean = lstMean.reduceRegion(ee.Reducer.mean(), ruralBuffer, 1000);
// Calculate temperature difference
var tempDiff = urbanMean.get('LST_Day_1km').subtract(ruralMean.get('LST_Day_1km'));
print('Urban-Rural Temperature Difference:', tempDiff);
6. Visualize the Data
Display the LST map with a color palette and overlay the urban and rural regions for comparison.
// Visualization parameters
var visParams = {
min: 280,
max: 330,
palette: ['blue', 'cyan', 'yellow', 'red']
};
// Add the LST map to the visualization
Map.addLayer(lstMean, visParams, 'Mean LST');
// Add urban and rural area layers
Map.addLayer(urbanArea, {color: 'red'}, 'Urban Area');
Map.addLayer(ruralBuffer, {color: 'green'}, 'Rural Buffer');
7. Export the Results
Export the final LST map or temperature difference data as a GeoTIFF or CSV file for further analysis or sharing.
// Export to Google Drive
Export.image.toDrive({
image: lstMean,
description: 'UHI_LST_Map',
fileNamePrefix: 'uhi_lst_map',
region: urbanArea,
scale: 1000,
maxPixels: 1e10
});
Example Output
Once the code runs, a map displaying LST variations across your study area will appear. The urban area will show higher temperatures compared to the rural buffer, highlighting the UHI effect.

FAQ
What resolution does MODIS LST data provide?
MODIS LST data is available at 1 km resolution, making it suitable for regional or city-scale analyses.
Is MODIS LST data freely accessible in GEE?
Yes, MODIS datasets are publicly available in GEE and require no additional licensing for academic or research purposes.
How accurate is MODIS LST for UHI mapping?
MODIS LST is accurate for large-scale studies but may have limitations in small or heterogeneous urban areas. For higher resolution, consider using Landsat or Sentinel-2 data.
Can I use this method for other satellites or sensors?
Yes, similar approaches can be adapted for other satellites. GEE supports multiple datasets, so you can replace MODIS with Landsat, Sentinel-2, or ASTER as needed.
How to handle missing data in MODIS LST?
GEE provides tools like .mask() or .qualityMosaic() to manage missing values. Filter the collection by quality, or use a composite image to reduce gaps.






