Search code examples
javascriptgoogle-earth-engine

Mosaicking in Google Earth Engine


Im trying to create a mosaic in Google Earth Engine and get an error message 'b.call is not a function' on the line in which i add the layer to the map. Does anyone know what is going on?

var path38 = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
                  .filterDate('2013-07-20', '2013-08-01')
                  .filter(ee.Filter.or(
                  ee.Filter.and(ee.Filter.eq('WRS_PATH', 38),
                  ee.Filter.eq('WRS_ROW', 25)),
                  ee.Filter.and(ee.Filter.eq('WRS_PATH', 38),
                  ee.Filter.eq('WRS_ROW', 26)),
                  ee.Filter.and(ee.Filter.eq('WRS_PATH', 38),
                  ee.Filter.eq('WRS_ROW', 27))));
var visParams = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 8000,
  max: 20000,
  gamma: 2.8,
};
Map.addLayer(path38, visParams, 'path38SR2011');

var p38mos = path38.mosaic;
var visParams = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 8000,
  max: 20000,
  gamma: 2.8,
};

Map.addLayer(p38mos, visParams, 'p38_2013');

Solution

  • var p38mos = path38.mosaic;
    

    You missed actually calling the method, and thus got a type error later. This line should be:

    var p38mos = path38.mosaic();