how to find cloud cover score of landsat image?

by misha mehra   Last Updated July 12, 2019 06:22 AM - source

var rajasthan_image = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')

.filterBounds(district)
.filterDate('2015-03-01','2015-05-01')
.sort('CLOUD_COVER')
.map(maskClouds)
.median();

this is my code and i want to find cloud cover of rajasthan image..I tried this code:

var getCloudScores = function(rajasthan_image)

{ //Get the cloud cover

var value = ee.Image(rajasthan_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??



Related Questions