i want to obtain the pixel values of an image for all bands in Google Earth Engine. My code is wrong(Error: Invalid argument: 'collection' must be a FeatureCollection. (Error code: 3)). I can see data with print. But couldn't export to CSV.
`
var geometry =
/* color: #d63000 */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[26.9559366037084, 39.42848463948233],
[26.9559366037084, 39.41562180312237],
[26.971214466257226, 39.41562180312237],
[26.971214466257226, 39.42848463948233]]], null, false);
var kor = ee.Image(ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterBounds(geometry)
.filterDate('2020-06-01', '2020-8-31')
.filterMetadata('CLOUD_COVER','less_than',5)
.sort('CLOUD_COVER')
.first());
var data = ee.FeatureCollection(
kor.reduceRegion({
reducer: ee.Reducer.toList(),
geometry: geometry,
scale: 30,
maxPixels: 1e9
}));
print(data);
Map.centerObject(kor)
Map.addLayer(kor,{bands:["B4","B3","B2"],min:0,max:5000})
Export.table.toDrive({
collection: data,
description: 'rgbb',
})
I expecting export all bands' pixel values to CSV file