I am working on translating some models a colleague created in ERDAS Imagine into Google Earth Engine. The model specifics in Imagine are largely irrelevant but the general steps are:

  1. Perform a tasseled cap transformation on a Landsat scene and retain brightness, greenness, and wetness.
  2. Reclassify the 3-bands into bins (1 through 8) representing each pixel's deviation from the mean, scaled by the standard deviation of the whole image.
  3. Combine these 3 bands into a single band image with 512 classes where the value represents a unique combination of brightness, greenness and wetness binned values. For instance, if in the 3-band image the brightness/greenness/wetness bin values of a pixel were 1/3/5, the single-band image should display a value of 135 for that pixel.

I have succeeded in getting the first two steps to work but now need to create the final image with the 512 discrete classes. How can I accomplish this in GEE? I have tried using .and(), .cat() and explored if I could convert the band values to strings prior to using the .add() function but have come up empty.

Code below is not very useful but will hopefully provide an example of the products I need to combine.

// binned, discrete brightness image
var brightness_bp8 = ee.Image('users/ryanpatrickrock/SAL_lcTimeSeries/raster/boulder_07132017_brightness_bp8')
// Map.addLayer(brightness_bp8, {min: 1, max: 8}, 'brightness')

// binned, discrete greenness image
var greenness_bp8 = ee.Image('users/ryanpatrickrock/SAL_lcTimeSeries/raster/boulder_07132017_brightness_bp8')
// Map.addLayer(greenness_bp8, {min: 1, max: 8}, 'greenness')

// binned, discrete wetness image
var wetness_bp8 = ee.Image('users/ryanpatrickrock/SAL_lcTimeSeries/raster/boulder_07132017_wetness_bp8')
// Map.addLayer(wetness_bp8, {min: 1, max:8}, 'wetness')

// 3 band image of all binned values
var bp_cat = ee.Image.cat(brightness_bp8, greenness_bp8, wetness_bp8)
// print(bp_cat)
// Map.addLayer(bp_cat)

1 Answer 1


I think the easiest way to do this would be to just use band math:

var thematic = brightness_bp8.multiply(ee.Image(100))

Good luck with the model!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.