0

This is my code, i tried to generate the time series chart but the error message show up - "No features contain non-null values of "system:time_start".

I use the same function to generate chart in my NDVI time series and works fine.

can anyone help me to solve this question?

var endDate = '2023-07-16'

var albedo = function(image) {
var alb = image.expression(
"((0.356*blue)+(0.130*red)+(0.373*nir)+(0.085*swir)+(0.072*swir2) - 0.018)/ 1.016",
{
'red': image.select('B4'),
'blue': image.select('B2'),
'nir': image.select('B8'),
'swir': image.select('B11'),
'swir2': image.select('B12')
});
return(image.addBands(alb.rename("albedo")));
};


var dataset = ee.ImageCollection("COPERNICUS/S2_SR")
.filterDate(startDate, endDate)
.filterBounds(roi)
.map(albedo);

print ("dataset", dataset);



var myAlbedo = dataset.select("albedo"); // Isolar só a banda do albedo
print("myAlbedo", myAlbedo); //

var AlbedoFinal = ee.Image(dataset.mean()).clip(roi);


var chart2 = ui.Chart.image.series({
  imageCollection: AlbedoFinal.select("albedo"),
  region: roi,
  reducer: ee.Reducer.first(),
  scale: 30,
 
}).setOptions({title: 'Série Temporal Albedo'});

// Display the chart in the console.
print(chart2);```

1 Answers1

0

There is no time start in your example. Something like

var startDate = '2023-06-16'
Daria T
  • 31
  • 4