Google Earth Engine Tutorial: Monitor Urban Night-time Lights with VIIRS
Credit: Youtube Channel “Terra Spatial, Guide on monitoring urban night-time light patterns using VIIRS dataset for economic and urban studies.”
You can see all the tutorials from here: Techgeo Academy.
Google Earth Engine Tutorial: Monitor Urban Night-time Lights with VIIRS
In recent years, urban night-time lights have become a critical indicator for analyzing socioeconomic activities, energy consumption, and urban development. The Visible Infrared Imaging Radiometer Suite (VIIRS) aboard the Suomi NPP satellite provides high-resolution nighttime light data, making it a valuable resource for monitoring urban growth and light pollution. This tutorial will guide you on using Google Earth Engine (GEE) to access, visualize, and analyze VIIRS data for urban night-time light monitoring.
Step 1: Access VIIRS Night-time Light Data in GEE
To begin, open the Google Earth Engine Code Editor and load the VIIRS dataset. Use the following code:
// Load VIIRS night-time light data
var viirs = ee.ImageCollection("NOAA/VIIRS/NPP/2016");
// Filter by date (e.g., 2020 data) and geometry (optional)
var filtered = viirs.filterDate('2020-01-01', '2020-12-31').filterBounds(geometry);
// Select the relevant band for visualization
var brightness = filtered.select('avg_rad');
This code loads the VIIRS data, filters it by date and geographic area, and selects the ‘avg_rad’ band, which represents the average radiance of the nighttime lights.
Step 2: Preprocess the Data
Preprocessing ensures the data is clean and usable. For example, you can apply a mask to exclude invalid pixels:
// Apply a quality mask to the image collection
var qualityMask = viirs.select('avg_qf');
var masked = viirs.map(function(image) {
return image.updateMask(qualityMask.lt(4));
});
The ‘avg_qf’ band contains quality flags, where values below 4 indicate reliable data. This step helps improve accuracy by removing low-quality pixels.
Step 3: Visualize Night-time Lights
Visualization in GEE can be done using a palette to highlight the brightness of urban areas:
// Define visualization parameters
var visParams = {
min: 0,
max: 60,
palette: ['black', 'blue', 'cyan', 'yellow', 'red']
};
// Add the visualization to the map
Map.addLayer(brightness, visParams, 'Night-time Lights');
This code creates a gradient visualization, ranging from black (low brightness) to red (high brightness), allowing you to identify urban hotspots.
Step 4: Analyze Urban Night-time Light Patterns
Use statistical functions to analyze trends over time or compare regions. For instance, calculate the average nighttime light intensity for a specific city:
// Calculate the mean brightness for a region
var meanIntensity = brightness.mean();
Map.addLayer(meanIntensity, visParams, 'Average Night-time Light');
This method generates an average intensity map, useful for identifying consistent urban areas or changes over years.
Step 5: Export and Analyze Results
Finally, export your processed data for further analysis. For example, export the average light intensity as a GeoTIFF:
// Export result to Google Drive
Export.image.toDrive({
image: meanIntensity,
description: 'nighttime_lights_export',
folder: 'GEE_Exports',
fileNamePrefix: 'average_light_intensity',
region: geometry,
crs: 'EPSG:4326',
scale: 375
});
Adjust the ‘geometry’ variable to define your area of interest. This export can then be analyzed in GIS software or other platforms.
FAQ
What is VIIRS, and how does it differ from other sensors?
VIIRS (Visible Infrared Imaging Radiometer Suite) is a sensor on the Suomi NPP satellite that captures high-resolution images across multiple spectral bands. It is optimized for low-light imaging, making it ideal for monitoring night-time lights compared to other sensors with lower sensitivity.
Can VIIRS data be used for long-term trend analysis?
Yes, VIIRS provides a global dataset dating back to 2012, enabling the analysis of long-term patterns in urban development and light pollution.
Why do some areas show high brightness in GEE?
High brightness values often correspond to cities or urban centers. However, ensure your data is filtered to exclude anomalies like wildfires or gas flares, which can also contribute to high radiance.
How to handle processing time limitations in GEE?
GEE allows batch processing for large datasets. Use the ‘Export’ function to run tasks in the background and avoid timeouts during manual execution.
Are there any restrictions on using VIIRS data in GEE?
VIIRS data is available for public use under NOAA’s terms of service. Always review the licensing and usage policies before sharing or publishing results.
By following these steps, you can effectively monitor urban night-time lights with VIIRS in Google Earth Engine. This approach supports academic research, urban planning, and environmental impact studies. For advanced analysis, consider integrating VIIRS data with other datasets like population density or land cover maps to enhance insights.





