Skip to content

mapbiomas/brazil-urban-area

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Urban Area

Developed by MapBiomas Urban Areas Mapping Group, composed by students and researchers from:

  • LabCart
  • LASERE
  • NEEPC
  • NEPA
  • QUAPÁ
  • YBY
  • UFBA

About

This documentation provides general information on the urban area mapping procedures developed by the MapBiomas Project for Collection 10 products. The applied concepts and the main accuracy results are presented in the Algorithm Theoretical Basis Document (ATBD) for urban areas (see https://mapbiomas.org/). Here we highlight the sequential procedures to map urban areas based on satellite imagery and reference base-maps.

How to use

Basics

Some basic steps are necessary before starting programming. They are:

  • Create an account in the GEE platform. It can be done here https://earthengine.google.com/
  • Create a GEE repository in the code editor and upload the modules in it.

Which topics of the ATBD do we cover here?

Topics covered in this git

Topic Description (if not included, why?)
✅ Satellite imagery Includes all codes to obtain a complete mosaic with all bands used during the classification
✅ Classification algorithm Includes all codes applied for urban mapping within Google Earth Engine based on Random Forest (RF) algorithm.
✅ Post-processing steps Includes post-classification codes applied for urban areas refinement.

Satellite imagery

Codes necessary for satellite imagery.

Codes Description
preProcessing_lib.js Code with functions to scale Landsat images, remove clouds and shadow clouds.
renameBands.js Code with dictionaries and functions useful for adequate Landsat band names (including all Landsat missions).
index_lib.js Library with index calculation functions used during the mosaic production.
mosaic_production.js Generates mosaics from Landsat images covering all the time series.

The mosaic_production.js is the main code - within which pre-processing, rename bands, and indices are operated. It is called during the classification procedures.

Classification algorithm

Classification steps within Google Earth Engine

Codes necessary for conducting the classification.

Codes Description
class_lib.js Sets up a classification procedure using Random Forest (RF) algorithm.
classification_batch.js Perform the classification using mosaics, samples, and the classifier. The classification is performed annually based on a regular grid. The result is a probability layer.
temporalStabByRegion.js After producing the classification (as a probability layer) by year and grid unit, a temporal harmonization is applied. This is a simply calculation of the mean probability considering a range of five years for each year.
bestProb_preProcessingByGridByYear.js Using the probability harmonized layer, this code prepares the necessary files to estimate the best probability threshold to be used as a cut-off value for binary classification of urban areas. The result is processed by grid and year and analyzed externally.
meanThresholdsByGridAsImage.js After calculating the best threshold externally (see Urban classification threshold analysis using python), an image with best selected threshold is produced to be used as a mask value by grid.

Urban classification threshold analysis using python

Codes necessary for calculating the best threshold for urban areas binary classification.

Codes Description
preProcessingThreshold.ipynb Calculate the best threshold to be used as a cut-off value for urban binary classification. The results are presented by grid and year containing both the Receiver Operating Characteristic (ROC) curve and percentiles analysis. The average threshold table is the main output of this code, which must be ingested in GEE as a .CSV file.

Post-processing steps

Ancillary datasets created to mask areas where urbanization can be detected (spatial filter mask)

Codes Description
buildingsAndBuffers.js Code necessary to create a raster from which buildings and their surroundings are considered to mask the occurrence of urban areas.
referenceLayers.js Code necessary to create a raster from which reference datasets are prepared to compose the spatial mask of occurrence of urban areas. Examples of data are census tracts, roads and infrastructures, and slums.

Codes used for applying the probability threshold and filters (temporal and spatial) for refinement of the results

Codes Description
posProcessingFilter.js Code necessary to provide spatial and temporal consistency. The code operates several steps:
- Obtain breakpoints from which urban classification frequency after a year under analysis is greater than non-urban classification frequency. This code enables an analysis of "when" a pixel becomes urban throughout the time series.
- Apply the selected probability threshold and provide temporal consistency throughout the time series based on breakpoint analysis and limit the occurrence of urban areas within spatial masks (temporal filter + spatial filter).

Processing steps

Steps necessary to conduct the urban areas classification

  1. In your GEE repository, create a folder where you will save the codes
  2. After creating a file for each one of the GEE codes above mentioned, adequate all the repository address to your folders
  3. The sequence of codes are:
    -> classification_batch.js
    -> temporalStabilizationByRegion.js
    -> bestProb_preProcessingByGridByYear.js
    -> preProcessingThreshold.ipynb
    -> meanThresholdsByGridAsImage.js
    -> buildingsAndBuffers.js
    -> referenceLayers.js
    -> posProcessingFilter.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages