I am new to Google Earth Engine and QGIS. I have a Polygon of a city and I have a CSV file for 30000 unique geocode (belonging to the participants who were entered in the study) I want to obtain the value of the NDVI at each location at the start time of the study (which is 2014) and then I want to have the mean NDVI for the period 2014-2016 at each location. I mean I should have two values for the NDVI.
here is the code but I don't know how to change it to have min, max, and mean NDVI in 30000 geocode. I mean is it possible to have "min, max, and mean NDVI" just in the desired location?
Map.centerObject(geometry);
Map.addLayer(geometry, {color: 'FF0000'}, 'geodesic polygon');
var imagecol = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR")
.filterDate('2014-05-01', '2016-07-31')
.filter(ee.Filter.calendarRange(5, 7, 'month'))
.filterBounds(geometry)
.sort('CLOUD_COVER', false)
var getNDVI = function(image) {
var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI');
return image.addBands(ndvi);
};
var withNDVI = imagecol.map(getNDVI);
var greenest = withNDVI.qualityMosaic('NDVI');
var NDVI = greenest.select('NDVI');
var NDVI = NDVI.clipToCollection(geometry);
var zonalNDVI = NDVI.reduceRegions({
collection: geometry,
reducer: ee.Reducer.mean(),
scale: 30,
crs: 'EPSG:3310',
});
print(zonalNDVI);
Export.table.toDrive({collection: zonalNDVI, fileFormat: 'GeoJSON'}); ```