I need to download a bunch of Landsat images for my thesis. My problem seems simple but I don't have a clue about JavaScript and the documentation didn't help enough.
I have filtered the collection to my region and time period and i want to export all images to Drive, seperately.
Collection example:
var surfaceReflectanceL5 = ee.ImageCollection('LANDSAT/LT5_SR');
var dateSR5=surfaceReflectanceL5.filterDate('1984-01-01', '1985-01-01');
var prSR5=dateSR5.filter(ee.Filter.eq('wrs_path', 182))
.filter(ee.Filter.eq('wrs_row', 35));
The code for exporting a single image is:
Export.image.toDrive({
image: image1 //example, var image1='Landsat/....'
description: 'L51984_1',
scale: 30,
});
How can I iterate through the collection to export all images? The use of map() function seems to be the answer.
prSR5.map(Export.image.toDrive({
image: image,
description: 'L51984',
scale: 30,
}));
The question is how to set the image parameter to the correct image (i.e first the 1st image, then the 2nd etc, something like 'thisImage()
' ) and the description to match image (i.e. 'L51984_1'
,'L51984_2'
...).
Many thanks in advance!!!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…