0

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." – Faru May 9 '18 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 '18 at 9:50
  • Oh, okay! I have edited the question thank you – Faru May 11 '18 at 18:21
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.

  • Thanks - when i comment out the print statements though, the endmembers are still null, the error appears later when I try to export table to drive. – Faru May 10 '18 at 21:15
  • No way to know why without knowing more about the geometries and images. – Nicholas Clinton May 11 '18 at 1:36
  • Sorry, I figured out how to link the whole code code.earthengine.google.com/d82288e11c364b3037fdbca5e185c116 – Faru May 11 '18 at 21:08

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.