I am wondering why the two approaches to calculate the area of a feature collection return different results and which one is "correct"?
- I clip the feature collection on a white image and sum up over the multiplied area
var whiteImage = ee.Image().unmask().eq(0).rename('test')
var trueAreaImage = whiteImageClipped.multiply(ee.Image.pixelArea());
var trueArea = trueAreaImage.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: validationRegion,
scale: 10
});
- The other time I am using a reducer to generate the raster data and sum up over the multiplied area
var reducedImage = groundTruth.reduceToImage(['test'],'anyNonZero').rename('test')
var trueAreaImage = reducedImage.multiply(ee.Image.pixelArea());
var trueArea = trueAreaImage.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: validationRegion,
scale: 10
});
The result of the two approaches is significantly different.
https://code.earthengine.google.com/8baa2a6c27490ca44d7904f7ab6208be