Google Earth Engine – How to Obtain NDVI Mean Value for Specific Point Across Multiple Sites

google-earth-enginendvisatellite

I'm trying to get multiple site at the same time from LANDSAT 8. The next error appears when I run it.

ImageCollection (Error)
Error in map(ID=20210906):
Image.reduceRegions: The default WGS84 projection is invalid for aggregations. Specify a scale or crs & crs_transform.

The code below:

var fechafin= ('2022-02-28')
var fechaini = ('2021-09-01')

 Filter collection to dates of interest.
var NDVI = ee.ImageCollection('LANDSAT/LC08/C01/T1_8DAY_NDVI')
.filterDate(fechaini, fechafin)
.filterBounds(potreros)
.select('NDVI')
print(NDVI)

// Transform NDVI in Radi Landsaatt NDVIi

var addDate = function(image){
  var doy = image.date().getRelative('day', 'year')
var doyBand = ee.Image.constant(doy).uint16().rename('doy')
  return image.addBands(doyBand)
}
var NDVIn = NDVI.map(addDate)
print('n',NDVIn)

var addPAR = function(image){
var f = image.expression('15.402168 - 0.000000011*(x**4) + 0.000007543*(x**3) - 0.001310832*(x**2) + 0.009646584*x', {
      'x': image.select('doy')
  }).rename('PAR')
  return image.addBands(f)
}
var NDVIo = NDVIn.map(addPAR)
print('o',NDVIo)

var addfPAR = function(image){
//var f = image.expression('min(max((1+NDVI)/(1-NDVI)/9.916077458,0),0.95)', {
var f = image.expression('min(max(0.008* exp(5.41 * (NDVI/10000)),0),0.95)', {
      'NDVI': image.select('NDVI')
  }).rename('fPAR')
 
  return image.addBands(f)
}
var NDVIp = NDVIo.map(addfPAR)
print('p',NDVIp)

var addAPAR = function(image){
var f = image.expression('PAR*fPAR', {
      'fPAR': image.select('fPAR'),
      'PAR': image.select('PAR')
  }).rename('APAR')
 
  return image.addBands(f)
}
var NDVIq = NDVIp.map(addAPAR)
print('q',NDVIq)

////////////////////////////////////////////////////////////
// Export
////////////////////////////////////////////////////////////

var datos = NDVIq.map(function(i){
  return i.reduceRegions(potreros, 'first')
})
print('datos11',datos)
var extract = ee.FeatureCollection(datos.flatten())
print(extract)

Export.table.toDrive({
  collection: extract,
  description: 'NDVI_fPAR',
  fileFormat: 'CSV',
});

Best Answer

Based in your error message, I search which is the command syntax for reduceRegions in this link. So, I modified following function in your code as:

var datos = NDVIq.map(function(i){
  return i.reduceRegions(potreros, ee.Reducer.mean(), 30);
});

After running complete code in GEE code editor (I assumed an arbitrary area for potreros geometry), it ran without any issue; as it can be observed in following picture.

enter image description here