0

I got an Error: "Invalid argument: 'collection' must be a FeatureCollection. (Error code: 3)", when I was trying to export FeatureCollection. Geometry was a rectangle I draw to clip the featurecolletion.

var dataset = ee.FeatureCollection('LARSE/GEDI/GEDI02_A_002/GEDI02_A_2021244154857_O15413_04_T05622_02_003_02_V002')
              .filterBounds(geometry);
dataset = dataset.style({color: 'black',  pointSize: 1});
Map.setCenter(-64.88, -31.77, 15);
Map.addLayer(dataset);

Export.table.toDrive({
collection: dataset,
description:"GEDI",
fileFormat: 'csv'
});

However, it worked if I replace 'collection: dataset' with 'collection: ee.FeatureCollection('LARSE/GEDI/GEDI02_A_002/GEDI02_A_2021244154857_O15413_04_T05622_02_003_02_V002').filterBounds(geometry)'. I'm not sure why I can't export dataset here.

1 Answer 1

0

Calling dataset.style() doesn't just add styling information; it converts the FeatureCollection into an Image with the features painted using that style.

  • If you want to export features to a table, don't call style(). There is no way to convey the style information in a CSV, anyway.
  • If you want to see a picture with the specific style you have chosen, you will have to Export.image instead of Export.table.
1
  • Hi Kevin, thanks so much. It's very clear now.
    – Dong
    Dec 14, 2022 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.