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.

  • 2
    Welcome to GIS SE. Thank you for taking the Tour. please include your code in the question body, as code fragment if necessary. Links to external sites fail over time.
    – Vince
    Sep 11, 2018 at 0:35

2 Answers 2


Use flatten() to flatten a collection of collections.


To retain the hierarchy, you can just export your nested collection as GeoJSON file with this line of code:

Export.table.toDrive({collection: extractL8fc, fileFormat: 'GeoJSON'});

GeoJSON is a widely used data exchange format, so it should be easy to ingest the data into the analysis tool of your choice.

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.