Using Landtrend library in Earth Engine, I can use a property that comes as default to calculate the square mean error (RMSE) and, then use this property to apply the current formula for this model:

(Math.round(ltData.rmse * 100) / 100).toString()

I just need to select 'rmse' property inside the 'LTRESULT'. First, I need to reduce to the level of each one of the fifth samples (samplesVegPrimaCinquenta).

  reducer: ee.Reducer.first(),
  geometry: samplesVegPrimaCinquenta, 
  scale: 30, 
}).evaluate(function(ltData){ ...

I want to return this value (RMSE) as a property inside each feature in the FeatureCollection, but I can't do this.

var triplets = collection.map(
  function(image) {
  return image.reduceRegions({
    collection: samplesVegPrimaCinquenta, 
    reducer: ee.Reducer.mean().setOutputs(image.bandNames()), 
    scale: 30,
    function(feature) {
    return feature.set({
      'imageID': image.id(),
      'date': ee.Date(image.get('system:time_start')).format('Y-MM-dd'),
       // Calculate rmse and set as propertie inside each feature in featureCollection
      'Fit RMSE: ': (Math.round(ltData.rmse * 100) / 100).toString()

Here's the LINK code, the script is a little big so, this part it is in line 178-208


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.