I am using GEE to download specific S2 tiles (by name) for some interval:
// Define the tile you want to download
var tileId = '14SLB';
// bands to download
var bands = ['B4', 'B3', 'B2', 'B1', 'B5', 'B6', 'B7', 'B8', 'B8A', 'B9', 'B11', 'B12', 'SCL']; // Example bands: blue, green, red, near-infrared, scene classification
// Define the date range
var startDate = '2022-05-01';
var endDate = '2022-05-30';
// Load the Sentinel-2 image collection for the specified tile
var collection = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED')
.filter(ee.Filter.eq('MGRS_TILE', tileId))
.filterDate(startDate, endDate)
.sort('system:time_start');
//iterate over collection
var S2_list = collection.toList(collection.size());
var l = collection.size().getInfo();
for (var i = 0; i < l; i++) {
var image = ee.Image(S2_list.get(i));
var acquisitionDate1 = image.date().format('YYYY-MM-dd');
var filename = ee.String('S2_').cat(acquisitionDate1);
var imageToDownload = image.select(bands).toUint16();
var bounds = imageToDownload.geometry().bounds();
//continue;
Export.image.toDrive({
image: imageToDownload,
description: filename.getInfo(),
folder: 'GEE_Images', // Specify the folder in your Google Drive
scale: 10, // Adjust the scale if needed
maxPixels: 1e13,
region: bounds,
crs: 'EPSG:4326' // Adjust the CRS if needed
});
}
for a reason I don't understand for each tile I am getting two images, for example:
- S2_2022-05-02-0000000000-0000000000.tif ( ~ 3GB)
- S2_2022-05-02-0000000000-0000013056.tif (~30 MB)
where (1) contains almost 99% from the tile and (2) contains the negligible rest.
Why is that happening if I specifically chose an MGRS tile in my filtering and most importantly how can I download 1 image per tile (I don't need (2), (1) is enough for me)
I have tried to omit the region
and it made no difference.