Geographic Information Systems Asked by rpr_mt on August 6, 2020
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:
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')
.clip(ROI)
// 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')
.clip(ROI)
// 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')
.clip(ROI)
// 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)
I think the easiest way to do this would be to just use band math:
var thematic = brightness_bp8.multiply(ee.Image(100))
.add(greenness_bp8.multiply(ee.Image(10)))
.add(wetness_bp8);
Good luck with the model!
Answered by Jean on August 6, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP