2

I am running a landtrendr script which returns some disturbance-related values (year of disturbance, duration... among others) for an area. I would like to reduce the result of the area by a large feature collection, containing approximately 50 geometries, but whenever I try reduceRegions using a feature collection the landtrendr values come back as NULL. Using reduceRegions using a single geometry yields expected results. I have used reduceRegions in similar landtrendr scripts with success.

https://code.earthengine.google.com/653980324a2b05f8060a8d3ea1e5d0da

var features = [
  geom1, geom2
];
var featColl = ee.FeatureCollection(features)

//print(featColl);
// define collection parameters
var startYear = 2001;
var endYear = 2012;
var startDay = '06-20';
var endDay = '09-20';
//var aoi = ee.Geometry.Point(-122.8848, 43.7929);
var aoi = AOI
var index = 'NDVI';
var maskThese = ['cloud', 'shadow', 'snow', 'water'];

// define landtrendr parameters
var runParams = { 
  maxSegments:            6,
  spikeThreshold:         0.9,
  vertexCountOvershoot:   3,
  preventOneYearRecovery: true,
  recoveryThreshold:      0.25,
  pvalThreshold:          0.05,
  bestModelProportion:    0.75,
  minObservationsNeeded:  6
};

// define change parameters
var changeParams = {
  delta:  'loss',
  sort:   'greatest',
  year:   {checked:true, start:2002, end:2012},
  mag:    {checked:true, value:200,  operator:'>'},
  dur:    {checked:true, value:4,    operator:'<'},
  preval: {checked:true, value:300,  operator:'>'},
  mmu:    {checked:true, value:11},
};

//##########################################################################################
// END INPUTS
//##########################################################################################

// load the LandTrendr.js module
var ltgee = require('users/emaprlab/public:Modules/LandTrendr.js'); 

// add index to changeParams object
changeParams.index = index;

// run landtrendr
var lt = ltgee.runLT(startYear, endYear, startDay, endDay, aoi, index, [], runParams, maskThese);

// get the change map layers
var changeImg = ltgee.getChangeMap(lt, changeParams);
print('changeImg', changeImg);


var reducedCI = changeImg.reduceRegions({
  reducer: ee.Reducer.max(),
  collection: geom1,
  scale: 30
});
print('reducedCI', reducedCI)

/*Export.table.toDrive({
  collection: reducedCI,
  folder: 'Test_Folder',
  description:'reducedCItest',
  fileFormat: 'CSV'
});
*/

In the script I am trying to reduce the image "changeImg" by a test feature collection containing two geometries, with the output being a feature collection "reducedCI". Any idea why only null values are being returned?

0

Your Answer

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

Browse other questions tagged or ask your own question.