I'm quite new to Google Earth Engine and I think my issue might be quite easily resolved, but I've made these two codes as I'm having issues with each of them. I'm trying to export the landsat imagery, either the entire file or a subset within the bounds of roi. Here was my first attempt:
var roi =
/* color: #d63000 */
/* shown: false */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[-121.8802978515625, 44.437465346193136],
[-121.8802978515625, 43.72323520263136],
[-120.68828125, 43.72323520263136],
[-120.68828125, 44.437465346193136]]], null, false),
landsat = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");
// Filter Down the imagery
var imagery = landsat.filterDate('2016-04-30', '2016-05-02').filterBounds(roi)
.sort('CLOUD_COVER', false);
//View the imagery
var visParams = {bands: ['B4', 'B3', 'B2'], min: 0, gamma: 1.4};
Map.addLayer(imagery, visParams, 'Bend Landsat');
Map.setCenter(-121.29, 44.0945, 13);
// Export the image, specifying scale and region.
Export.image.toDrive({
image: imagery.select('B10','B11'),
description: 'imageToDriveExample',
scale: 30,
region: roi,
maxPixels:1e11
});
I just get an error. This is my error:
Error: Image.clipToBoundsAndScale, argument 'input': Invalid type. Expected: Image. Actual: ImageCollection.
How can I get this right?
This was my second technique. It works, but it does this weird thing where it exports the imagery as 4 separate files. I can mosaic them together, but they don't exactly look the same.
var roi =
/* color: #d63000 */
/* shown: false */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[-121.8802978515625, 44.437465346193136],
[-121.8802978515625, 43.72323520263136],
[-120.68828125, 43.72323520263136],
[-120.68828125, 44.437465346193136]]], null, false),
landsat = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");
var batch = require('users/fitoprincipe/geetools:batch');
// Filter Down the imagery
var imagery = landsat.filterDate('2016-04-30', '2016-05-02').filterBounds(roi)
.sort('CLOUD_COVER', false);
//View the imagery
var visParams = {bands: ['B4', 'B3', 'B2'], min: 0, gamma: 1.4};
Map.addLayer(imagery, visParams, 'Bend Landsat');
Map.setCenter(-121.29, 44.0945, 13);
// Download imagery
batch.Download.ImageCollection.toDrive(imagery, 'Folder',
{scale:15, region:roi.getInfo()[[[-121.8802978515625,43.72323520263136],[-120.68828125,43.72323520263136],[-120.68828125,44.437465346193136],[-121.8802978515625,44.437465346193136]]], type:'float'});
Is there any way for me to get it to my drive as one file?