首页 > 其他分享 >Google Earth Engine(GEE)——ndvi.gt is not a function

Google Earth Engine(GEE)——ndvi.gt is not a function

时间:2023-06-03 17:01:04浏览次数:59  
标签:Engine function Google map SR im var select


你好,


我试图通过屏蔽值的上下 10 个百分位数来消除计算出的 NDVI 数据集中的异常值,但我在第 398 行中不断收到错误消息,显示第 398 行: ndvi.gt不是函数。 我怎样才能解决这个问题?


 原始代码:

var table = ee.FeatureCollection("users/selenachav5/mangrove_vector"),
    Upper = 
    /* color: #d63000 */
    /* shown: false */
    /* displayProperties: [
      {
        "type": "rectangle"
      },
      {
        "type": "marker"
      },
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry({
      "type": "GeometryCollection",
      "geometries": [
        {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -81.2407135715856,
                25.79366283798797
              ],
              [
                -81.2407135715856,
                25.77758769332227
              ],
              [
                -81.22148749736685,
                25.77758769332227
              ],
              [
                -81.22148749736685,
                25.79366283798797
              ]
            ]
          ],
          "geodesic": false,
          "evenOdd": true
        },
        {
          "type": "Point",
          "coordinates": [
            -81.32741223482145,
            25.738523746255495
          ]
        },
        {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -81.82460825109085,
                25.96361611727523
              ],
              [
                -81.82460825109085,
                24.946857002999202
              ],
              [
                -80.1574329581221,
                24.946857002999202
              ],
              [
                -80.1574329581221,
                25.96361611727523
              ]
            ]
          ],
          "geodesic": false,
          "evenOdd": true
        }
      ],
      "coordinates": []
    }),
    Lower = /* color: #98ff00 */ee.Geometry.Point([-81.16010932282697, 25.231743823283935]),
    Mid = /* color: #0b4a8b */ee.Geometry.Point([-81.08192793682238, 25.35792290478201]),
    TTI = /* color: #00ffff */ee.Geometry.Point([-81.56369714187413, 25.872789041185186]),
    geometry = 
    /* color: #0000ff */
    /* shown: false */
    ee.Geometry.Point([-80.93190442232145, 25.542910956897835]),
    imageVisParam = {"opacity":1,"bands":["constant"],"max":1,"palette":["ff0000","a52a2a","008000"]},
    geometry2 = 
    /* color: #d63000 */
    /* shown: false */
    /* displayProperties: [
      {
        "type": "rectangle"
      },
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.MultiPolygon(
        [[[[-81.81911508702835, 25.95620775711364],
           [-81.81911508702835, 24.956817897095913],
           [-80.15468637609085, 24.956817897095913],
           [-80.15468637609085, 25.95620775711364]]],
         [[[-80.9045032706221, 26.01052489646315],
           [-80.9045032706221, 25.93644985046701],
           [-80.8715442862471, 25.93644985046701],
           [-80.8715442862471, 26.01052489646315]]]], null, false),
    table2 = ee.FeatureCollection("users/selenachav5/nps_boundary"),
    image2 = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA"),
    image3 = ee.ImageCollection("LANDSAT/LC08/C02/T1_RT_TOA"),
    image4 = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2");

print(table.limit(10), 'table')
Map.addLayer(table, {}, 'raw table',0)




// Get bounding box for your geometry
var bbox = table.geometry().bounds();
Map.addLayer(bbox, {}, 'bounding box')

// Convert mangrove to image
var mangroveImg = ee.Image(0).paint(table, 1);
Map.addLayer(mangroveImg, {min:0, max:1}, 'mangroveImg')

var enpbound = ee.Image(0).paint(table2, 1);
Map.addLayer(mangroveImg, {min:0, max:1}, 'enpbound')

// Now you can map over the collection and mask out all non-mangrove pixels

function maskNonMangrove(i){
  return i.updateMask(mangroveImg).copyProperties(i);
}

function maskENP(i){
  return i.updateMask(enpbound).copyProperties(i);
}

function maskL8(im) {
  var qa = im.select('QA_PIXEL');
  var mask = qa.eq(21824);
  return im.updateMask(mask).copyProperties(im);
}

//var water = function(image) {
  //var qa = image.select('QA_PIXEL');
  /// Check that the cloud bit is off.
  // See https://www.usgs.gov/media/files/landsat-8-9-olitirs-collection-2-level-1-data-format-control-book
 // var mask = qa.bitwiseAnd(7).eq(0);
 // return image.updateMask(mask);
//};

//var image = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");

var Before = image4
  .filterBounds(geometry2)
  .filterDate('2013-04-01', '2017-09-08')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})

var After = image4
  .filterBounds(geometry2)
  .filterDate('2017-09-09', '2023-01-01')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))}) 
  
var Thirteen = image4
  .filterBounds(geometry2)
  .filterDate('2013-01-01', '2013-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  //.map(water)
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})

var ThirteenM = image4
  .filterBounds(geometry2)
  .filterDate('2013-01-01', '2013-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})


var FourteenPercent = image4
  .filterBounds(geometry2)
  .filterDate('2014-01-01', '2014-12-31')
  .map(function(im) {return (im.normalizedDifference(['SR_B5', 'SR_B4']))})
  .reduce(ee.Reducer.percentile([10]))

var Fourteen = image4
  .filterBounds(geometry2)
  .filterDate('2014-01-01', '2014-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})
  .map( function(im) {return im.select('nd').updateMask(im.select('nd').gt(FourteenPercent))})
  
  
  
 
var FourteenM = image4
  .filterBounds(geometry2)
  .filterDate('2014-01-01', '2014-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})

var Fifteen = image4
  .filterBounds(geometry2)
  .filterDate('2015-01-01', '2015-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})
  
  var FifteenM = image4
  .filterBounds(geometry2)
  .filterDate('2015-01-01', '2015-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})


var Sixteen = image4
  .filterBounds(geometry2)
  .filterDate('2016-01-01', '2016-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})
  
  var SixteenM = image4
  .filterBounds(geometry2)
  .filterDate('2016-01-01', '2016-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})


 var Seventeen = image4
  .filterBounds(geometry2)
  .filterDate('2017-01-01', '2017-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})

var SeventeenM = image4
  .filterBounds(geometry2)
  .filterDate('2017-01-01', '2017-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})


var Eighteen = image4
  .filterBounds(geometry2)
  .filterDate('2018-01-01', '2018-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})

var EighteenM = image4
  .filterBounds(geometry2)
  .filterDate('2018-01-01', '2018-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})
  
 var Nineteen = image4
  .filterBounds(geometry2)
  .filterDate('2019-01-01', '2019-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})
 
 var NineteenM = image4
  .filterBounds(geometry2)
  .filterDate('2019-01-01', '2019-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})
 
 var Twenty = image4
  .filterBounds(geometry2)
  .filterDate('2020-01-01', '2020-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})
var TwentyM = image4
  .filterBounds(geometry2)
  .filterDate('2020-01-01', '2020-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})
  
 var TwentyOne= image4
  .filterBounds(geometry2)
  .filterDate('2021-01-01', '2021-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})

var TwentyTwo = image4
  .filterBounds(geometry2)
  .filterDate('2022-01-01', '2022-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})


 var TwentyOneM= image4
  .filterBounds(geometry2)
  .filterDate('2021-01-01', '2021-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})

var TwentyTwoM = image4
  .filterBounds(geometry2)
  .filterDate('2022-01-01', '2022-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  //.map(water)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})




 
var DecadePercent = image4
  .filterBounds(geometry2)
  .filterDate('2013-01-01', '2023-12-31')
  .map(function(im) {return (im.normalizedDifference(['SR_B5', 'SR_B4']))})
  .reduce(ee.Reducer.percentile([10]))
 

var Decade= image4
  .filterBounds(geometry2)
  .filterDate('2013-01-01', '2022-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  .map(function(im) {var opticalBands = im.select('SR_B.').multiply(0.0000275).add(-0.2);return im.addBands(opticalBands,null,true)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})

var DecadeM= image4
  .filterBounds(geometry2)
  .filterDate('2013-01-01', '2022-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  .map(function(im) {return im.select(['SR_B.']).multiply(0.0000275).add(-0.2)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B6']))})
  
var DecadeO= image4
  .filterBounds(geometry2)
  .filterDate('2013-01-01', '2022-12-31')
  .map(maskL8) // this is fine
  .map(maskNonMangrove) 
  .map(maskENP)
  .map(function(im) {var opticalBands = im.select('SR_B.').multiply(0.0000275).add(-0.2);return im.addBands(opticalBands,null,true)})
  .map(function(im) {return im.addBands(im.normalizedDifference(['SR_B5', 'SR_B4']))})
  .map( function(im) {return im.select('nd').updateMask(im.select('nd').gt(FourteenPercent))})

  //.map( function(im) {return im.select('nd').updateMask(im.select('nd').gt(FourteenPercent))})
  
// Add mean NDVI to the map to inspect



//Map.addLayer(Before.select('nd').mean(), {min:0, max:1, palette:['red','brown','green']}, 'mean NDVI mangroves Before')
//Map.addLayer(After.select('nd').mean(), {min:0, max:1, palette:['red','brown','green']}, 'mean NDVI mangroves After')
Map.addLayer(Thirteen.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2013')
Map.addLayer(Fourteen.select('nd'), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2014')
Map.addLayer(Fifteen.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2015')
Map.addLayer(Sixteen.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2016')
Map.addLayer(Seventeen.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2017')
Map.addLayer(Eighteen.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2018')
Map.addLayer(Nineteen.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2019')
Map.addLayer(Twenty.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2020')
Map.addLayer(TwentyOne.select('nd').mean(), {min:0, max:0.8, palette:['#ffffcc','#c2e699','#78c679','#31a354','#006837']}, 'NDVI 2021')
Map.addLayer(ThirteenM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2013')
Map.addLayer(FourteenM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2014')
Map.addLayer(FifteenM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2015')
Map.addLayer(SixteenM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2016')
Map.addLayer(SeventeenM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2017')
Map.addLayer(EighteenM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2018')
Map.addLayer(NineteenM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2019')
Map.addLayer(TwentyM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Mositure 2020')
Map.addLayer(TwentyOneM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2021')
Map.addLayer(TwentyTwoM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Moisture 2022')
Map.addLayer(DecadeM.select('nd').mean(), {min:0, max:0.8, palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']}, 'Decade Mositure')


var vis = {min: 0, max: 0.8, palette:'#ffffcc,#c2e699,#78c679,#31a354,#006837'}
var palette= ['#ffffcc','#c2e699','#78c679','#31a354','#006837']
var vis2 = {min: 0, max: 0.8, palette:'#eff3f,#bdd7e7,#6baed6,#3182bd,#08519c'}
var palette2= ['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c']
function makeColorBarParams(palette2) {
  return {
    bbox: [0, 0, 1, 0.1],
    dimensions: '100x10',
    format: 'png',
    min: 0,
    max: 1,
    palette:['#eff3ff','#bdd7e7','#6baed6','#3182bd','#08519c'],
  };
}

var colorBar = ui.Thumbnail({
  image: ee.Image.pixelLonLat().select(0),
  params: makeColorBarParams(vis2.palette2),
  style: {stretch: 'horizontal', margin: '0px 8px', maxHeight: '24px'},
});

// Create a panel with three numbers for the legend.
var legendLabels = ui.Panel({
  widgets: [
    ui.Label(vis2.min, {margin: '4px 8px'}),
    ui.Label(
        ((vis2.max-vis2.min) / 2+vis2.min),
        {margin: '4px 8px', textAlign: 'center', stretch: 'horizontal'}),
    ui.Label(vis2.max, {margin: '4px 8px'})
  ],
  layout: ui.Panel.Layout.flow('horizontal')
});

var legendTitle = ui.Label({
  value: 'Normalized Difference Mositure Index',
  style: {fontWeight: 'bold'}
});

// Add the legendPanel to the map.
var legendPanel = ui.Panel([legendTitle, colorBar, legendLabels]);
Map.add(legendPanel);

var ndviB = Before.select('nd')
var ndvia = After.select('nd')
var ndvi = Decade.select('nd')
var ndviOL= DecadeO.select('nd')

var P_95_NDVI = ndvi.reduce(ee.Reducer.percentile([95]));
var P_05_NDVI = ndvi.reduce(ee.Reducer.percentile([5]));







var NDVI_P = ndvi.updateMask(ndvi.gt(P_05_NDVI).and(ndvi.lt(P_95_NDVI)));

var Moisture = DecadeM.select('nd')
var Change = Thirteen.select('nd');Fourteen.select('nd');Fifteen.select('nd');Sixteen.select('nd');Seventeen.select('nd');Eighteen.select('nd');Nineteen.select('nd');Twenty.select('nd');TwentyOne.select('nd')





//print(ui.Chart.image.series(ndviB,Upper,ee.Reducer.mean(), 30, 'system:time_start'))
//print(ui.Chart.image.series(ndviA,Upper,ee.Reducer.mean(), 30, 'system:time_start'))
//print(ui.Chart.image.series(ndviB,Lower,ee.Reducer.mean(), 30, 'system:time_start'))
//print(ui.Chart.image.series(ndviA,Lower,ee.Reducer.mean(), 30, 'system:time_start'))
//print(ui.Chart.image.series(ndviB,Mid,ee.Reducer.mean(), 30, 'system:time_start'))
print(ui.Chart.image.series(ndviA,Mid,ee.Reducer.mean(), 30, 'system:time_start'))
//print(ui.Chart.image.series(ndviB,TTI,ee.Reducer.mean(), 30, 'system:time_start'))
//print(ui.Chart.image.series(ndviA,TTI,ee.Reducer.mean(), 30, 'system:time_start'))

print(ui.Chart.image.series(ndvi, Mid, ee.Reducer.mean(), 30, 'system:time_start'))
print(ui.Chart.image.series(ndviOL, Mid, ee.Reducer.mean(), 30, 'system:time_start'))
print(ui.Chart.image.series(DecadeM, Mid,ee.Reducer.mean(), 30, 'system:time_start'))


// You need to submit it as an export task

问题1:Line 398: ndvi.gt is not a function

这个问题主要的是影像集合和影像之间的差异,function不能直接作用在影像上,所以我们对之前的代码进行分析就可以了,正确代码如下:

var ndviB = Before.select('nd')
var ndvia = After.select('nd')
var ndvi = Decade.select('nd').mosaic()
var ndviOL= DecadeO.select('nd').mosaic()

var P_95_NDVI = ndvi.reduce(ee.Reducer.percentile([95]));
var P_05_NDVI = ndvi.reduce(ee.Reducer.percentile([5]));

var NDVI_P = ndvi.updateMask(ndvi.gt(P_05_NDVI).and(ndvi.lt(P_95_NDVI)));

var Moisture = DecadeM.select('nd')
var Change = Thirteen.select('nd');Fourteen.select('nd');Fifteen.select('nd');Sixteen.select('nd');Seventeen.select('nd');Eighteen.select('nd');Nineteen.select('nd');Twenty.select('nd');TwentyOne.select('nd')

问题2:

Error generating chart: No features contain non-null values of "system:time_start".

Google Earth Engine(GEE)——ndvi.gt is not a function_function

 这个问题请查看:

参看:

(1039条消息) Google Earth Engine(GEE)——求随机点中的长时序的各波段的折线图(附给矢量集合添加时间属性

标签:Engine,function,Google,map,SR,im,var,select
From: https://blog.51cto.com/u_15654855/6408263

相关文章

  • tink google 加密安全实践的框架
    tink是google多年加密实践的框架,提供了安全的加密处理方法,可以简化不少我们的加密处理参考使用publicstaticvoidmain(String[]args)throwsGeneralSecurityException,IOException{AeadConfig.register();//1.Generatethekeymateri......
  • tflearn tensorflow LSTM predict sin function
    from__future__importdivision,print_function,absolute_importimporttflearnimportnumpyasnpimportmathimportmatplotlibmatplotlib.use('Agg')importmatplotlib.pyplotaspltimporttensorflowastfstep_radians=0.001steps_of_histor......
  • [Libjingle 0.4]编译Libjingle 0.4+Linphone Voice Engine的总结之一
    在Windows下编译Libjingle0.4+LinphoneVoiceEngine时候会遇到一些问题,下面整理了一下,当然并不是所有的patch都有用的.http://code.google.com/p/libjingle/issues/detail?id=16***64-bit.patch******ortp.patch******gcc4.patch******libjingle-fileshare.patc......
  • [原创]通过代码及流程图说明Google在Android上的Push机制的实现
    [color=red][b]声明:如果您要转载,请事先征得本人的同意后方可并且请您附上原文链接.本人保留一切权利.多谢![/b][/color]Google从FroYo版本后引入了C2DM(CloudtoDeviceMessaging)框架:[url]http://code.google.com/android/c2dm/index.html[/url......
  • Google Java编程风格指南
    作者:Hawstein目录前言源文件基础源文件结构格式命名约定编程实践Javadoc后记前言这份文档是GoogleJava编程风格规范的完整定义。当且仅当一个Java源文件符合此文档中的规则,我们才认为它符合Google的Java编程风格。与其它的编程风格指南一样,这里所讨论的不仅仅是编码格......
  • How to check function arguments type in Python All In One
    HowtocheckfunctionargumentstypeinPythonAllInOnePython&argumenttypecheckbug❌argumentstypechecker#!/usr/bin/envpython3#coding:utf8#argumentstypechecker✅deffunc(arg1:int,arg2:bool,arg3:str):#arg1ifisinsta......
  • Angular Google Charts教程_编程入门自学教程_菜鸟教程-免费教程分享
    教程简介GoogleCharts是一个纯粹的基于JavaScript的图表库,旨在通过添加交互式图表功能来增强Web应用程序.它支持各种图表.在Chrome,Firefox,Safari,InternetExplorer(IE)等标准浏览器中使用SVG绘制图表.在传统的IE6中,VML用于绘制图形.AngularGoogleCharts是一个基于开源角度......
  • LangChain入门(二)-通过 Google 搜索并返回答案
    GitHub-liaokongVFX/LangChain-Chinese-Getting-Started-Guide:LangChain的中文入门教程LangChain的中文入门教程.ContributetoliaokongVFX/LangChain-Chinese-Getting-Started-GuidedevelopmentbycreatinganaccountonGitHub.https://github.com/liaokongVFX/LangCh......
  • Python function argument All In One
    PythonfunctionargumentAllInOnePython函数参数https://docs.python.org/3/library/typing.htmlhttps://docs.python.org/3/library/typing.html#typing.ParamSpec.argsfunctionargumenttypesdefaultargumentskeywordargumentspositionalargumentsarbitrary......
  • mysql functions ,LAST_INSERT_ID() 或 自定义主键
    http://dev.mysql.com/doc/refman/5.6/en/information-functions.html LAST_INSERT_ID() 这个值如果各个table都有一个自增的id,那么各个table用各自的LAST_INSERT_ID()  自定义:#固定前缀(2位)+时间戳(13位)+随机数(7位)SELECTCONCAT('AB',#......