I have two feature collections (before and after) that I want to subtract in Earth Engine. Each Feature Collection has an NDVI band computed, BF_NDVI
for the before Image and AF_NDVI
for the after collection.
I have written the function below from (Line 217) but it returns an error in Line 229: Object is not callable
.
Any ideas on how I can solve this to get the resulting difference feature collection for export?
//Positive difference image indicates NDVI loss in the after invasion image
print('Difference_Image', difference)
//Extract before mean NDVI value
var bfMean = beforeCollectionMeans.select('BF_NDVI').first();
print('Before_Mean_NDVI', bfMean)
//Extract after mean NDVI value
var afMean = afterCollectionMeans.select('AF_NDVI').first();
print('After_Mean_NDVI', afMean)
//Get the difference mean NDVI value
var df = function(feature) {
var diff = feature(bfMean).subtract(afMean)
return diff;
}
var dfMean = invasionbuffer.map(df);
print('Difference_Mean_NDVI', dfMean)
The link to the full script; https://code.earthengine.google.com/ca15125c7b699144a04fd16fd76fd312