I want to find cloud cover of an image This is my code:
var image = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterBounds(district)
.filterDate('2015-03-01','2015-05-01')
.sort('CLOUD_COVER')
.map(maskClouds)
.median();
I tried this code:
var getCloudScores = function(image)
{
//Get the cloud cover
var value = ee.Image(image).get('CLOUD_COVER');
return ee.Feature(null, {'score': value})
};
var results = landsat.map(getCloudScores);
print(Chart.feature.byFeature(results));
It is giving me error:
landsat is not defined in this scope.
How do I calculate cloud cover and which variable I should use in place of landsat?
landsat
is not defined in this scope because you don't have an imageCollection calledlandsat
. Use the cloud scores function on your image and you should get an answer.