How to manipulate the new Landsat 9 images with GEE

R

Rida Azmi

Guest
Landsat 9 data processing

Hello,
In this tutorial, we will see how you can easily manipulate Landsat 9 images in the Google Earth Engine platform.

The goal is to easily display, analyze, calculate spectral indices (like NDVI), geometrically correct and finally export these images.
The access to the storage of Landsat 9 images (like all other images of the Landsat constellation) is through the following link, via the GEE platform.

The link below represents the Landsat 8 image catalog, so for the L9 data, it’s almost the same thing.
https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C02_T1_L2
In order to load the image collections in GEE, just type the code below:

كود:
var collection = ee.ImageCollection("LANDSAT/LC09/C02/T1_L2")
                 .filterDate('2022-02-01','2022-02-19')
                 .filterBounds(roi);

A filter is also applied to specify the date and the study area. In our case, we chose the region of Souss Massa whose chief place is the city of Agadir.
A print is applied to see the collection found in the servers for this study area.
print(collection);
The second step is to make a radiometric correction of this collection. For this, we will apply the correction parameters proposed by USGS.
The link below presents the metadata of the RAW data
we will apply a scale factor in order to switch from Digital Number – DN to reflectance data.

كود:
function applyScaleFactors(image) {
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              .addBands(thermalBands, null, true);
}

Then the function allows applying this calibration

var dataset = collection.map(applyScaleFactors);

The next step allows going from a collection of images to a single image by applying a “mosaic” type reduction.

var image = dataset.mosaic().clip(roi);

Then calculate the vegetation index of this new image and apply an appropriate color palette.

كود:
var ndvi = image.normalizedDifference(['SR_B5', 'SR_B4']).rename('NDVI');
var ndviPalette = ['FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718',
               '74A901', '66A000', '529400', '3E8601', '207401', '056201',
               '004C00', '023B01', '012E01', '011D01', '011301'];

Now it’s time for the display.

كود:
var visualization = {
  bands: ['SR_B5', 'SR_B4', 'SR_B3'],
  min: 0.0,
  max: 0.3,
};

Map.setCenter(-9.57603052720908, 30.406700766638988,7);

Map.addLayer(image, visualization, 'image');
Map.addLayer(ndvi, {min:0, max: 1, palette: ndviPalette}, 'ndvi');

It is possible to export these data via Google Drive with the script below

كود:
Export.image.toDrive({ 
  image: ndvi,
  description: 'Landsat_raj',
  scale: 30, 
  maxPixels: 10000000000000, 
  region: roi
});

Enjoy !!

Rida AZMI
Data Scientist / Urban Spatial Data

متابعة القراءة...
 
أعلى