Google Earth Engine(GEE)——Landsat7 补缺出现的问题

本次就是利用Landsat计算ndvi、ndwi、ndbi来进计算和展示的,我们特别是在计算Landsat7的时候会出现一些问题,这里给大家展示的是一个错误的案例,大家可以通过调节代码来继续分析。

代码:

/**** Start of imports. If edited, may not auto-convert in the playground. ****/
var roi = ee.FeatureCollection("users/vaibhavpuri/NCR");
/***** End of imports. If edited, may not auto-convert in the playground. *****/
var startYear = 2000;
var endYear = 2001;

var startDate = ee.Date.fromYMD(startYear, 1, 1);
var endDate = startDate.advance(1,'year');
// print(startDate, endDate)

// Cloud Mask

var cloudMaskL7 = function(image) {
  var dilatedCloud = (1 << 1)
  var cloud = (1 << 3)
  var cloudShadow = (1 << 4)
  var qa = image.select('QA_PIXEL');
  var mask = qa.bitwiseAnd(dilatedCloud)
    .and(qa.bitwiseAnd(cloud))
    .or(qa.bitwiseAnd(cloudShadow))
  // var mask = qa.bitwiseAnd(dilatedCloud).eq(0).an

你可能感兴趣的:(Google,Earth,Engine,大数据,javascript,Landsat,ndvi,ndwi)