From the following NDVI collection, I want to keep only the observations with Good Quality (equal to zero). I try to do this with the SummaryQA but I get "Pattern 'SummaryQA' did not match any bands". My attempt:

var geometry = /* color: #0b4a8b */ee.Geometry.Polygon(
  [[[110.49279650854476, 39.617434795765476],
    [111.02014025854476, 36.57484614339866],
    [117.48010119604476, 36.92695433193529],
    [117.43615588354476, 40.35816406661026]]]),modis =ee.ImageCollection("MODIS/006/MOD13Q1")
    .map(function(image){return image.clip(geometry)}) 
    var modisNDVI = modis.select("NDVI");

    var maskQA = function(image) {
      return image.updateMask(image.select("SummaryQA").eq(0));
    var best = modisNDVI.map(maskQA)

When you select NDVI band, you are only keeping that band, so you cannot use other band.


var modisNDVI = modis.select("NDVI");


var modisNDVI = modis.select(["NDVI", "SummaryQA"]);
  • Thank you @Rodrigo. In this case though, when I try to perform a batch download of the best collection, I get "Failed to decode JSON. Error: Type must be one of: [compoundvalue, date, bytes, point, dictionary, function, invocation, multipoint, linestring, linearring, multilinestring, polygon, multipolygon, geometrycollection, argumentref, valueref]. Object: "FeatureCollection"." – foo Jan 21 '19 at 13:39
  • how are you trying to batch download? – Rodrigo E. Principe Jan 21 '19 at 14:07
  • var batch = require('users/fitoprincipe/geetools:batch') batch.Download.ImageCollection.toDrive(best, "m_ar", {scale:250,region: geometry.getInfo()}); – foo Jan 21 '19 at 14:08
  • try with geometry instead of geometry.getInfo() – Rodrigo E. Principe Jan 21 '19 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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