Google Earth Engine Tutorial: Analyze Urban Expansion with GHSL Data
Credit: Youtube Channel “Terra Spatial, Tutorial on analyzing urban expansion patterns from 1975 to 2020 using GHSL built-up surface data.”
You can see all the tutorials from here: Techgeo Academy.
Introduction to Google Earth Engine and GHSL Data
Google Earth Engine (GEE) is a powerful platform for planetary-scale environmental data analysis and visualization. The Global Human Settlement Layer (GHSL) dataset provides high-resolution satellite-derived information on human settlements, including built-up areas and population density. This tutorial demonstrates how to use GHSL data in GEE to analyze urban expansion patterns over time.
Getting Started with GHSL Data in Google Earth Engine
To begin, you need access to the GHSL dataset, which is available in GEE’s public repository. The dataset includes multiple layers such as built-up area density, population estimates, and urban classification. Hereβs how to load and visualize the data:
// Load GHSL dataset
var ghsl = ee.Image('COPERNICUS/GHSL/P2019/TVG15');
// Visualize built-up area density
Map.setCenter(0, 0, 2);
Map.addLayer(ghsl.select('BuiltUpDensity'), {
min: 0, max: 100,
palette: ['white', 'gray', 'black']
}, 'Built-Up Density');
This code loads the GHSL dataset and visualizes the built-up area density layer. The density ranges from 0 (non-built) to 100 (high density), mapped with a grayscale palette.
Steps to Analyze Urban Expansion
1. Filter Time Periods: GHSL data is available for multiple years. Use the filterDate() function to select specific time ranges. For example:
var urbanExpansion = ghsl.filterDate('2000-01-01', '2020-12-31');
2. Calculate Urban Area Changes: Create a time series by aggregating the built-up density over different periods. Use reduceRegion() to compare areas:
var urban2000 = ghsl.filterDate('2000-01-01', '2000-12-31')
.select('BuiltUpDensity')
.reduce(ee.Reducer.sum());
var urban2020 = ghsl.filterDate('2020-01-01', '2020-12-31')
.select('BuiltUpDensity')
.reduce(ee.Reducer.sum());
var change = urban2020.subtract(urban2000);
3. Export Results: Use GEEβs export.image() function to save the analysis results as a GeoTIFF or CSV file for further processing.
Export.image.toDrive({
image: change,
description: 'UrbanExpansionChange',
folder: 'GEE_Exports',
fileNamePrefix: 'urban_change',
region: geometry,
scale: 100,
maxPixels: 1e13
});
Visualizing Urban Expansion Over Time
To better understand urban expansion trends, create an animated time series. Use ui.Chart.image.series() to plot built-up area density changes across years:
var chart = ui.Chart.image.series({
imageCollection: urbanExpansion.select('BuiltUpDensity'),
region: geometry,
reducer: ee.Reducer.sum(),
scale: 100
});
chart.setOptions({
title: 'Urban Expansion Over Time',
hAxis: {title: 'Year'},
vAxis: {title: 'Built-Up Density'},
legend: {position: 'right'}
});
print(chart);
This generates a chart showing the evolution of urban density within the specified region.
Advanced Analysis: Identifying Urban Growth Hotspots
For deeper insights, cross-reference GHSL data with other datasets like land cover or elevation. Use overlay analysis to pinpoint areas of significant expansion:
var landCover = ee.Image('ESA/GLOBCOVER_LC1_200901_200912_V2.3');
var urbanGrowth = landCover.select('landcover').eq(10)
.and(ghsl.select('BuiltUpDensity').gt(50));
This example identifies regions where urban density exceeds 50% and land cover is classified as built-up.
FAQ
What are the spatial and temporal resolutions of GHSL data?
The GHSL dataset provides data at 1 km resolution for the years 1975, 1990, 2000, 2015, and 2020. For finer details, datasets like TVG15 offer 250m resolution.
Can I use GHSL data for global-scale urban analysis?
Yes, GHSL data covers the entire globe, making it ideal for large-scale studies. However, higher-resolution datasets may require more computational resources in GEE.
How do I handle missing data or errors in GHSL?
GHSL data sometimes includes missing values. Use mask() or clip() functions to remove invalid pixels. For instance:
var maskedGhsl = ghsl.updateMask(ghsl.neq(-9999));
What tools can I pair with GHSL for better insights?
Combine GHSL with datasets like MODIS land cover, Sentinel-2 imagery, or nightlight data to analyze urban growth and development patterns comprehensively.







