Lab 10 - Challenge: Mapping Urban Areas

Objective: Use the Normalized Difference Built-Up Index (NDBI) to map urban areas.

What You'll Learn

  • Calculate the Normalized Difference Built-Up Index (NDBI)
  • Understand why SWIR is useful for identifying urban surfaces
  • Apply threshold-based classification to create binary maps
  • Compare NDBI to NDVI for different land cover types
  • Interpret urban mapping results critically

Building On Previous Learning

This lab combines skills from multiple previous labs:

  • Lab 8 - Band arithmetic and normalized difference formulas
  • Lab 9 - Threshold-based classification using .gt() and .lt()

Why This Matters

Urban mapping is critical for:

  • Urban planning: Understanding where cities are expanding
  • Heat island studies: Impervious surfaces increase local temperatures
  • Hydrological modeling: Urban areas have different runoff characteristics
  • Population estimation: Built-up areas correlate with population density
  • Climate research: Tracking urbanization as a driver of land use change

Before You Start

  • Prerequisites: Finish Labs 8-9 and confirm your challenge site meets the data availability guidelines.
  • Estimated time: 90 minutes
  • Materials: Earth Engine account, AOI geometry file or coordinates, and any reference maps or census layers you plan to compare.

Key Terms

NDBI (Normalized Difference Built-Up Index)
A spectral index that highlights urban/built-up areas using the formula: (SWIR - NIR) / (SWIR + NIR)
SWIR (Short-Wave Infrared)
Wavelengths from ~1.5-2.5 μm. Urban surfaces (concrete, asphalt) reflect strongly in SWIR.
Impervious Surface
Surfaces that don't absorb water (roads, rooftops, parking lots). A key indicator of urbanization.
Binary Classification
A classification with only two classes: in this case, urban (1) vs. non-urban (0).

Introduction

Combine your knowledge of spectral indices, thresholds, and image filtering to identify and map urban areas. In this challenge, you'll calculate the Normalized Difference Built-Up Index (NDBI) and apply thresholds to create a Boolean map of urban areas.

The NDBI was developed by Zha et al. (2003) to aid in differentiating urban areas (e.g., densely clustered buildings and roads) from other land cover types. The index exploits the fact that urban areas generally have a great deal of impervious surface cover, reflecting SWIR very strongly.

Reading

Read: Zha, Y., Gao, J., & Ni, S. (2003). Use of normalized difference built-up index in automatically mapping urban areas from TM imagery. International journal of remote sensing, 24(3), 583-594.

The NDBI Formula

The formula is:

NDBI = (SWIR - NIR) / (SWIR + NIR)

Compare to NDVI:

  • NDVI = (NIR - Red) / (NIR + Red) → Highlights vegetation
  • NDBI = (SWIR - NIR) / (SWIR + NIR) → Highlights built-up areas

Notice that NDBI uses SWIR instead of Red, and the band order is reversed!

Band Selection for Sentinel-2

Index First Band Second Band Sentinel-2 Bands
NDBI SWIR NIR B11, B8
NDVI NIR Red B8, B4

NDBI Interpretation

NDBI Value Range Typical Land Cover Reason
> 0.1 Urban/Built-up High SWIR reflectance from concrete, asphalt
0 to 0.1 Mixed/Transitional Suburban areas, sparse development
< 0 Vegetation/Water NIR reflectance exceeds SWIR

Challenge Tasks

Task 1: Calculate NDBI (40 points)

Calculate the Normalized Difference Built-Up Index (NDBI) for the sfoImage used in Lab 8 - Band Arithmetic - NDVI.

Reminder: The San Francisco image was from Sentinel-2, filtered to a specific date and location.

You can use either:

  • Manual calculation: (SWIR - NIR) / (SWIR + NIR)
  • Or the normalizedDifference() method

Display it with an appropriate color palette.

Task 2: Create a Boolean Urban Map (10 points)

Calculate a threshold that maps out the urban area as a Boolean (binary) classification.

Steps:

  1. Use the Inspector tool to examine NDBI values in urban vs. non-urban areas
  2. Determine an appropriate threshold value (typically NDBI > 0 indicates built-up areas)
  3. Apply the threshold using .gt() method
  4. Display the result with two colors (e.g., white for non-urban, red for urban)

Sample Code Structure

// Load San Francisco area image (from Lab 8)
var sfoPoint = ee.Geometry.Point([-122.4194, 37.7749]);
var sfoImage = ee.ImageCollection('COPERNICUS/S2')
    .filterBounds(sfoPoint)
    .filterDate('2020-01-01', '2020-12-31')
    .sort('CLOUDY_PIXEL_PERCENTAGE')
    .first();

// Calculate NDBI
// Hint: Use .normalizedDifference(['B11', 'B8'])
var ndbi = sfoImage.normalizedDifference(['B11', 'B8']);

// Map NDBI with color palette
Map.addLayer(ndbi, {
    min: -1, 
    max: 1, 
    palette: ['blue', 'white', 'red']
}, 'NDBI');

// Apply threshold to create Boolean urban map
var urbanThreshold = 0.0;  // Adjust based on your inspection!
var urbanMask = ndbi.gt(urbanThreshold);

// Display Boolean map
Map.addLayer(urbanMask, {
    palette: ['white', 'red']
}, 'Urban Areas');

Check Your Understanding

  1. Why does NDBI use SWIR instead of the Red band used in NDVI?
  2. If a pixel has an NDBI of 0.3 and an NDVI of -0.1, what type of land cover is it likely to be?
  3. What might cause false positives (non-urban areas classified as urban) in your NDBI map?
  4. Why is threshold selection important, and how would you validate your chosen threshold?

Troubleshooting

Problem: NDBI shows strange values (very high or very low everywhere)

Solution: Check your band order! The formula is (B11 - B8), not (B8 - B11). For normalizedDifference(), the first band is the positive one.

Problem: Water appears as built-up in your urban map

Solution: Water can have similar NDBI values to some built-up areas. Consider using NDWI or a water mask to exclude water bodies.

Problem: Bare soil is classified as urban

Solution: NDBI can confuse bare soil with built-up areas because both have low vegetation. This is a known limitation - advanced methods combine NDBI with NDVI.

Pro Tips

  • Combine indices: Urban = (NDBI > threshold) AND (NDVI < threshold) improves accuracy
  • Use the Inspector: Click on known features (parking lots, roofs, parks) to understand typical values
  • Compare visually: Toggle between your urban map and a basemap to assess accuracy
  • Document your threshold: Explain WHY you chose your threshold value in your comments

Key Takeaways

  • NDBI highlights built-up areas using the SWIR band
  • Urban surfaces (concrete, asphalt) have high SWIR reflectance
  • Threshold selection requires visual inspection and validation
  • NDBI alone may confuse bare soil with urban areas - combining with NDVI helps

📋 Lab Submission

Subject: Lab 10 - Mapping Urban Areas - [Your Name]

Submit:

A URL to your code with comments that includes:

  1. NDBI Calculation - Code to calculate and display NDBI (40 points)
  2. Boolean Urban Map - Code to threshold NDBI and create binary classification (10 points)
  3. Comments - Well-commented code explaining your threshold choice (10 points)

Total: 60 Points