0% found this document useful (0 votes)
14 views1 page

Landsat 8 PAN Drive

The document provides a script for filtering and processing Landsat 8 imagery using Google Earth Engine. It filters images based on location and date, retrieves the least cloudy image, and prepares a pansharpened image for export. The final output includes visualization of the original and processed images, along with instructions for exporting the image to Google Drive.

Uploaded by

Alisson Machado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Landsat 8 PAN Drive

The document provides a script for filtering and processing Landsat 8 imagery using Google Earth Engine. It filters images based on location and date, retrieves the least cloudy image, and prepares a pansharpened image for export. The final output includes visualization of the original and processed images, along with instructions for exporting the image to Google Drive.

Uploaded by

Alisson Machado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//filtrar imagens

var sr_landsat = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA")


.filterBounds(geometry)
.filterDate('2021-01-01', '2022-03-31');

print(sr_landsat);

// Get the number of images.


var count = sr_landsat.size();
print('Count: ', count);

// Get the date range of images in the collection.


var range = sr_landsat.reduceColumns(ee.Reducer.minMax(), ["system:time_start"])
print('Date range: ', ee.Date(range.get('min')), ee.Date(range.get('max')))

// Sort by a cloud cover property, get the least cloudy image.


var image = ee.Image(sr_landsat.sort('CLOUD_COVER').first());
print('Least cloudy image: ', image);

// Limit the collection to the 10 most recent images.


var recent = sr_landsat.sort('system:time_start', false).limit(10);
print('Recent images: ', recent);

// Imagem cortada para a área, em um único arquivo (camada)

var rgb = image.select('B4', 'B3', 'B2');


var pan = image.select('B8');

// Convert to HSV, swap in the pan band, and convert back to RGB.
var huesat = rgb.rgbToHsv().select('hue', 'saturation');
var sr_landsat = ee.Image.cat(huesat, pan).hsvToRgb();

// There are many fine places to look; here is one. Comment


// this out if you want to twiddle knobs while panning around.
Map.centerObject(geometry, 10);

// Display before and after layers using the same vis parameters.
Map.addLayer(rgb, {max: 0.3}, 'Original');
Map.addLayer(sr_landsat, {max: 0.3}, 'Pansharpened');

// Export the image, specifying scale and region.


// alterar apenas o description
Export.image.toDrive({
image: sr_landsat,
description: image.get('LANDSAT_PRODUCT_ID').getInfo(),
scale: 10,
region: geometry
});

//clicar em Run, depois em aba Tasks -> Run

You might also like