Does anyone have an idea how I could aggregate my Image so that in the output the most frequent value is used, as shown on the picture?

this is the same question as aggregate raster using the most frequent value but using the earthengine API
Does anyone have an idea how I could aggregate my Image so that in the output the most frequent value is used, as shown on the picture?

this is the same question as aggregate raster using the most frequent value but using the earthengine API
You control how pixels are aggregated with the pyramidPolicy property in exports. In your case, you want to use mode.
var image = ee.Image('USGS/GFSAD1000_V1')
.clip(geometry)
Export.image.toAsset({
image: image,
pyramidingPolicy: {'.default': 'mode'},
scale: 100000
})
https://code.earthengine.google.com/cc36b36bc0d8374dcf3483c87252f0eb
Update
When exporting to drive, pyramidingPolicy cannot be specified. Something like this could work:
var scale = 10000
var image = ee.Image('USGS/GFSAD1000_V1')
.clip(geometry)
var reprojected = image
.reduceResolution({
reducer: ee.Reducer.mode(),
maxPixels: 65536 // Max input pixels for each output pixel
})
Export.image.toDrive({
image: reprojected,
scale: scale
})
https://code.earthengine.google.com/4058242ee0216ab76b9343a675066e7d
EEException: Unknown configuration options: {'pyramidingPolicy': 'mean'}. Is there a trick to use it anyway ?
– Pierrick Rambaud
Jul 20 '21 at 08:50
mode. – Daniel Wiell Jul 20 '21 at 08:38