0

As you can see, the result is 'yes', but my flag is 0, how could this happen? What can I do?

enter image description here

var img=imageCollection.filterBounds(geometry).filterDate('2021-08-09','2021-08-10').median();
print(img)
var flag=img.bandNames().size();
print(flag);

if(flag)
{
  print('yes')
}
bad_coder
  • 11,289
  • 20
  • 44
  • 72
  • Possible duplicate: https://gis.stackexchange.com/questions/343946/using-if-else-structure-in-google-earth-engine. Just write "if statement with gee" in google... – Allart Sep 03 '21 at 13:31
  • Can you share your code? – Binx Mar 29 '22 at 15:22

0 Answers0