0

Ideally, I'd like to be running a yearly chart observing NDBI of my selected geometry. I believe I may be missing part of the code for that, and I am unsure how to go about it. I'm running into the above error with the code:


var l8_2015 = l8.filterDate('2015-01-01', '2020-12-31');

var image = ee.Algorithms.Landsat.simpleComposite(  
{
 collection: l8_2015,
 asFloat: true 
});

Map.addLayer(image.clip(table), {bands: ['B4', 'B3', 'B2']}, 'landsat 8');

var ndbi = image.normalizedDifference(['B6', 'B5']).rename('NDBI');

var ndbiParams = {
  min: -1, 
  max: 1, 
  palette: ['cyan', 'red']
};



var bands = ['B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11', 'NDBI']; 

Map.addLayer(ndbi.clip(table), ndbiParams, 'ndbi');

var ndbi16Trends = ui.Chart.image.seriesByRegion({
  imageCollection:ndbi,
  regions:table,
  reducer: ee.Reducer.max(),
  band: 'NDBI',
  scale: 30

I believe I need to set system:time_start, but I'm not sure where it needs to go.

1 Answer 1

0

If you want to create time series chart from a single image, you need to have Image collection for that. ee.Algorithms.Landsat.simpleComposite takes Image collection as an input and returns an Image as an output.

Instead of doing this, you can create a map function to evaluate NDBI band for each and every image in your image collection then create a trend chart from that.

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.