Skip to main content
added 476 characters in body
Source Link
HamiEbra
  • 389
  • 2
  • 6

One way isIf you want to keep pixels that have a value of 15 or less than 15 and mask the rest of the pixels:

var riverflow = ee.Image('WWF/HydroSHEDS/15ACC');

var flowAccumulation = riverflow.select('b1');
//Map.addLayer(flowAccumulation)

var masked = flowAccumulation.updateMask(flowAccumulation.ltlte(15)); 
//Map.addLayer(masked)

On the other hand, If you want to mask the pixels that have a value of 15 or less than 15 and keep the rest of the pixels:

var riverflow = ee.Image('WWF/HydroSHEDS/15ACC');

var flowAccumulation = riverflow.select('b1');
//Map.addLayer(flowAccumulation)

var masked = flowAccumulation.updateMask(flowAccumulation.gte(15)); 
//Map.addLayer(masked)

Hope it helps.

One way is:

var riverflow = ee.Image('WWF/HydroSHEDS/15ACC');

var flowAccumulation = riverflow.select('b1');
//Map.addLayer(flowAccumulation)

var masked = flowAccumulation.updateMask(flowAccumulation.lt(15)); 
//Map.addLayer(masked)

Hope it helps.

If you want to keep pixels that have a value of 15 or less than 15 and mask the rest of the pixels:

var riverflow = ee.Image('WWF/HydroSHEDS/15ACC');

var flowAccumulation = riverflow.select('b1');
//Map.addLayer(flowAccumulation)

var masked = flowAccumulation.updateMask(flowAccumulation.lte(15)); 
//Map.addLayer(masked)

On the other hand, If you want to mask the pixels that have a value of 15 or less than 15 and keep the rest of the pixels:

var riverflow = ee.Image('WWF/HydroSHEDS/15ACC');

var flowAccumulation = riverflow.select('b1');
//Map.addLayer(flowAccumulation)

var masked = flowAccumulation.updateMask(flowAccumulation.gte(15)); 
//Map.addLayer(masked)

Hope it helps.

Source Link
HamiEbra
  • 389
  • 2
  • 6

One way is:

var riverflow = ee.Image('WWF/HydroSHEDS/15ACC');

var flowAccumulation = riverflow.select('b1');
//Map.addLayer(flowAccumulation)

var masked = flowAccumulation.updateMask(flowAccumulation.lt(15)); 
//Map.addLayer(masked)

Hope it helps.