gee-community/msslib

getCol with maxCloudCover set to 0 returns images with CLOUD_COVER greater than 0

boothmanrylan opened this issue · 0 comments

Reproducible example: https://code.earthengine.google.com/0060c69c481eb30ecce9d51c1c23580d

I think the issue comes from here, where because 0 evaluates as false it gets replaced by the default parameter of 50:

msslib/msslib.js

Lines 374 to 379 in e1e59cf

// Replace default params with provided params.
if (params) {
for (var param in params) {
_params[param] = params[param] || _params[param];
}
}

Checking if the provided params are null or undefined has all the same behaviour as the current method, but allows maxCloudCover to be set to 0. For example:

// Replace default params with provided params.
  if (params) {
    for (var param in params) {
      if (params[param] != null) {
        _params[param] = params[param];
      }
    }
  }