colab Open in SageMaker Studio Lab Open in Planetary Computer

Landsat 4, 5 and 7 - Collection 2

Tutorial created by **David Montero Loaiza**: GitHub | Twitter

Let’s start!

If required, please uncomment:

[1]:
#!pip install eemont
#!pip install geemap

Import the required packages.

[2]:
import ee, eemont, geemap
import geemap.colormaps as cm

Authenticate and Initialize Earth Engine and geemap.

[3]:
Map = geemap.Map()

Let’s define a point of interest:

[4]:
poi = ee.Geometry.BBoxFromQuery("Belice",user_agent = "eemont-tutorial-029")

Landsat 4, 5 and 7, Collection 2, Pre-processing and Processing

eemont (v0.3.0) now supports pre-processing and processing of the Collection 2 of Landsat 4, 5 and 7!:

[5]:
L7 = (ee.ImageCollection("LANDSAT/LE07/C02/T1_L2")
      .filterBounds(poi)
      .filterDate("2020-01-01","2021-01-01")
      .preprocess()
      .spectralIndices("EVI")
      .median())
[11]:
L5 = (ee.ImageCollection("LANDSAT/LT05/C02/T1_L2")
      .filterBounds(poi)
      .filterDate("2000-01-01","2001-01-01")
      .preprocess()
      .spectralIndices("EVI")
      .median())
[9]:
L4 = (ee.ImageCollection("LANDSAT/LT04/C02/T1_L2")
      .filterBounds(poi)
      .filterDate("1992-01-01","1993-01-01")
      .preprocess()
      .spectralIndices("EVI")
      .median())

Let’s visualize everything using geemap (and also container emulation methods!):

[12]:
Map = geemap.Map()
Map.addLayer(L7[[2,1,0]],{"min":0,"max":0.3},"RGB L7 (2020)")
Map.addLayer(L5[[2,1,0]],{"min":0,"max":0.3},"RGB L5 (2000)")
Map.addLayer(L4[[2,1,0]],{"min":0,"max":0.3},"RGB L4 (1992)")
Map.addLayer(L7['EVI'],{"min":0,"max":1,"palette":cm.palettes.ndvi},"EVI L7 (2020)")
Map.addLayer(L5['EVI'],{"min":0,"max":1,"palette":cm.palettes.ndvi},"EVI L5 (2000)")
Map.addLayer(L4['EVI'],{"min":0,"max":1,"palette":cm.palettes.ndvi},"EVI L4 (1992)")
Map.centerObject(poi.centroid(1),10)
Map