Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 27 characters in body; edited tags
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Below is my code and it runs perfectly but when I run the unsubmitted task in gee,it gives this error: Error: Image.setDefaultProjection, argument 'image': Invalid type. Expected type: Image<unknown bands>. Actual type: ImageCollection. (Error code: 3)

Error: Image.setDefaultProjection, argument 'image': Invalid type. Expected type: Image. Actual type: ImageCollection. (Error code: 3)

var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
      .filterBounds(geometry)
      .filterDate('2019-11-17', '2020-03-31')


// Applies scaling factors.
function applyScaleFactors(image) {
  var qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);
  var saturationMask = image.select('QA_RADSAT').eq(0);
  
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              .addBands(thermalBands, null, true)
              .updateMask(qaMask)
              .updateMask(saturationMask);
}

dataset = dataset.map(applyScaleFactors);

var visualization = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 0.0,
  max: 0.3,
};


Map.addLayer(dataset, visualization, 'True Color (432)');

Export.image.toDrive({ 
  image: dataset,
  description: 'Landsat8_for_NDBI',
  scale: 10, 
  maxPixels: 1e13, 
  region: geometry 
});

Please anyCan you help me to bypass this, I have not seen any post that help?

Below is my code and it runs perfectly but when I run the unsubmitted task in gee,it gives this error: Error: Image.setDefaultProjection, argument 'image': Invalid type. Expected type: Image<unknown bands>. Actual type: ImageCollection. (Error code: 3)

var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
      .filterBounds(geometry)
      .filterDate('2019-11-17', '2020-03-31')


// Applies scaling factors.
function applyScaleFactors(image) {
  var qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);
  var saturationMask = image.select('QA_RADSAT').eq(0);
  
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              .addBands(thermalBands, null, true)
              .updateMask(qaMask)
              .updateMask(saturationMask);
}

dataset = dataset.map(applyScaleFactors);

var visualization = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 0.0,
  max: 0.3,
};


Map.addLayer(dataset, visualization, 'True Color (432)');

Export.image.toDrive({ 
  image: dataset,
  description: 'Landsat8_for_NDBI',
  scale: 10, 
  maxPixels: 1e13, 
  region: geometry 
});

Please any help to bypass this, I have not seen any post that help

Below is my code and it runs perfectly but when I run the unsubmitted task in gee,it gives this error:

Error: Image.setDefaultProjection, argument 'image': Invalid type. Expected type: Image. Actual type: ImageCollection. (Error code: 3)

var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
      .filterBounds(geometry)
      .filterDate('2019-11-17', '2020-03-31')


// Applies scaling factors.
function applyScaleFactors(image) {
  var qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);
  var saturationMask = image.select('QA_RADSAT').eq(0);
  
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              .addBands(thermalBands, null, true)
              .updateMask(qaMask)
              .updateMask(saturationMask);
}

dataset = dataset.map(applyScaleFactors);

var visualization = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 0.0,
  max: 0.3,
};


Map.addLayer(dataset, visualization, 'True Color (432)');

Export.image.toDrive({ 
  image: dataset,
  description: 'Landsat8_for_NDBI',
  scale: 10, 
  maxPixels: 1e13, 
  region: geometry 
});

Can you help me to bypass this?

Source Link

How to download Landsat8 data from Google Earth Engine

Below is my code and it runs perfectly but when I run the unsubmitted task in gee,it gives this error: Error: Image.setDefaultProjection, argument 'image': Invalid type. Expected type: Image<unknown bands>. Actual type: ImageCollection. (Error code: 3)

var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
      .filterBounds(geometry)
      .filterDate('2019-11-17', '2020-03-31')


// Applies scaling factors.
function applyScaleFactors(image) {
  var qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);
  var saturationMask = image.select('QA_RADSAT').eq(0);
  
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              .addBands(thermalBands, null, true)
              .updateMask(qaMask)
              .updateMask(saturationMask);
}

dataset = dataset.map(applyScaleFactors);

var visualization = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 0.0,
  max: 0.3,
};


Map.addLayer(dataset, visualization, 'True Color (432)');

Export.image.toDrive({ 
  image: dataset,
  description: 'Landsat8_for_NDBI',
  scale: 10, 
  maxPixels: 1e13, 
  region: geometry 
});

Please any help to bypass this, I have not seen any post that help