I am attempting to implement a classification based from a decision tree (attached as image below) where there are 5 classes. These classes are based off the different water reflectance values in Landsat 8 bands (namely NIR, Red and Green). I have no idea how I should go about doing this. Someone suggested using image.expression however it has not worked for me. This is the code I've used thus far: (landsat is landsat 8 surface reflection)
var image = ee.Image(landsat.filterDate ('2018-01-01', '2018-03-01').filterBounds(point).sort('CLOUD_COVER').first());
//print image
print('a landsat scene', image);
//implement MNDWI
var green = image.select('B3');
var swi = image.select('B6');
var mndvi = green.subtract(swi).divide(green.add(swi)).rename('MNDWI');
var mndvipara = {min: 0, max: 0.7, palette: ['white', 'blue']};
Map.addLayer(mndvi, mndvipara, 'MNDVI image');
//classification attempt
var lpb =image.expression (
'nir > 0.018', {
'nir': image.select ('B5')});
Map.addLayer (lpb, {min: -1, max: 1, palette: ['FF0000', '00FF00']});
[1]: https://i.sstatic.net/TKSbZ.png (if image doesn't work, classification can be found at https://www.sciencedirect.com/science/article/pii/S0303243415000641 - Figure A.1
.expression()
function?