I have shapefile of counties and want to calculate mean NDVI for each. I know reducing connected components and ee.reducer.mean
can be helpful in GEE but it wants it as CSV for further analysis in R pl.
1 Answer
First you have to use .reduceRegions()
to reduce your NDVI image over regions represeted as counties with ee.Reducer.mean()
reducer.
Then do export with Export.table.toDrive()
setting fileFormat
to 'csv'
.
Here's official tutorial and here's a link to a complete script with exporting.
Note: by default CSV output will contain all attributes from source features + column with an output of a chosen reducer - "mean"
in this case.