I am trying to do spectral unmixing over a Landsat 8 image collection. I want to take endmember values from a particular location in each scene, but I keep getting this error (I have already followed the debugging guide for this error)

 List (Error)
 Failed to decode JSON.
 Error: Field 'value' of object '{"type":"ArgumentRef","value":null}' is 
 missing or null.
 Object: {"type":"ArgumentRef","value":null}.

When I use the inspector to click on the polygons I am using to define my endmembers, there are just zero values (which explains the error message). The exact same code works when I'm running the code over a single image rather than an image collection.

Here is what I'm working with: SEE CODE HERE https://code.earthengine.google.com/d82288e11c364b3037fdbca5e185c116

I load my landsat collection with a cloud filter, then run this code:

 var sma_unmixL8 = (function(image) {
   var s_image= image.select("B2","B3","B4","B5","B6", "B7");

   //endmembers collected from each image scene.

   var veg = s_image.reduceRegion({reducer: ee.Reducer.mean(),
   geometry:veg_em, scale: 30, maxPixels: 1e8});
   var vegvalues = veg.values();
   print (vegvalues, 'vegvalues')

   var water= s_image.reduceRegion({reducer: ee.Reducer.mean(),
   geometry:water_em, scale: 30, maxPixels: 1e8});
   var watervalues = water.values();
   print(watervalues, 'watervalues')

   var soil= s_image.reduceRegion({reducer: ee.Reducer.mean(),
   geometry:soil_em, scale: 30, maxPixels: 1e8});
   var soilvalues = soil.values();
   print(soilvalues, 'soilvalues')

   //constrained to one no neg code
  var unmixed_a = s_image.unmix([watervalues, vegvalues, soilvalues],true,true);
  var unmixed =  unmixed_a.multiply(900);

   return unmixed;

The error appears for each endmember when I try to print. When I run the entire code with a single set of endmember values gathered from a single scene, it runs OK.

Any ideas?

  • edit: This error persists even after removing the printing. It will run and not display errors, but when I get to downloading the output it gives me an error saying " Image.unmix: Element 0 of list 'endmembers[1]' must not be null."
    – user118738
    May 9, 2018 at 22:59
  • 1
    For debugging it would be helpfull if you share the full code and all necessary Assets (geometries, fusion tables, etc.).
    – Kersten
    May 11, 2018 at 9:50
  • Oh, okay! I have edited the question thank you
    – user118738
    May 11, 2018 at 18:21

1 Answer 1


If your plan is to map that function over an ImageCollection, then the print() statements in there won't work. See the debugging doc and/or the client-server doc to understand why.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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