[GIS] Assigning categories to a single band raster in Google Earth Engine

google-earth-enginereclassify

I'm trying to assign bins to a raster containing values between -1 and 1 in GEE. The bins would be 0.41<x<0.60, 0.61<x<0.80 for example. Is there a function for this?

The only function I can find is image.remap which works for individual values rather than ranges.

Best Answer

var thresholds = ee.Image([0.4, 0.6, 0.8]);
var zones = image.lt(thresholds).reduce('sum');
Map.addLayer(zones, {min: 0, max: 3}, 'zones');
Related Question