I need to create a feature collection from a list containing coordinates and band values. These are extracted from a landsat image as shown in this linked script.
Extract complete pixel values inside a geometry
I'm unable to find a solution in creating a feature collection. Here is the tail end code.
var valuesList = joinedImage.reduceRegion({
reducer: ee.Reducer.toList(4),
geometry: myGeometry
}).values().get(0);
var feature = ee.Feature(null, valuesList);
// Wrap the Feature in a FeatureCollection for export.
var myFeatures = ee.FeatureCollection([feature]);
// Export the image, specifying scale and region.
Export.table.toDrive(myFeatures,
"data",
"myData",
"B4-B5",
"CSV");
This doesn't work, because it is clearly the wrong way to create the feature collection. I've tried to create it similar to Rodrigo E. Principe's solution of mapping a Feature Collection but I can't seem to create the initial feature collection to start with.