简体   繁体   中英

How to create images by calculating other images in Google Earth Engine?

I have some categorical images (Max, Min, MinUp, C) in GEE. Each image has integer values in different ranges. For example, C is [0, 35], and Max is [1, 20] etc.

I want to create a Boolean image: pixels that meet any two of the following criteria have a value of 1, while other pixels get 0. What I can think of is that I do 3 overlays of (1,2) (1,3) &(2,3) and take the union. Is there a sophisticated way to create the Boolean map?

  1. Max < 3.

  2. Min < MinUp/3

  3. C < 5

I didn't get an answer before I worked it out, so I am just gonna post mine here. I don't think it's sophisticated enough for more complicated conditions, but at least it's an one-line code for me.

var result = (C1.multiply(C2)).max((C1.multiply(C3)).max(C2.multiply(C3)));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM