[GIS] How to export a feature collection of feature collections in Google Earth Engine

exportfeaturesgoogle-earth-engineshapefile

I have extracted NDVI values from Landsat 8 images to a shapefile of points 90 meters apart. I am trying to get these point files back into ArcGIS and R, but they are too big to print to the console. Also, because I used the reduce region function, each feature in my collection is actually a feature collection. Is a for loop the way to export all these points (a feature collection of feature collections) to a shapefile? For each "feature" in the feature collection, I could take the name of the feature and use that as the file name to do Export.table.toDrive().

Alternatively, I have considered selecting each feature collection individually and exporting it, but that will be complicated in the future and I don't know enough about the table structure or the properties of feature collections to do that.

Here is the link to my code. Lines 74-79 are what I am having trouble extracting. I would eventually like to do this for all the Landsat satellites if I can.

Best Answer

Use flatten() to flatten a collection of collections.

Related Question