0

I'd like to reduce the resolution for a binary layer of the max extent of water, and I'd like the resulting layer to represent percent of water pixels. However when I use ee.Reducer.mean() as seen below, the resulting layer is only has binary values still. How can I get a float instead?

//The image in question
var water = ee.Image('JRC/GSW1_1/GlobalSurfaceWater').clip(roi);

//Current code
var watermodis = water.select(['max_extent'])
.reproject({
  crs:modisproj
}).reduceResolution({
  reducer:ee.Reducer.mean(),
});

1 Answers1

0

Turns out I just had the order of the reproject and the reduceResolution wrong, should be

var watermodis = water.select(['max_extent'])
.reduceResolution({
  reducer:ee.Reducer.mean(),
  maxPixels:1310
}).reproject({
  crs:modisproj
});