2

I have calculted the NDVI of specific plot and download it in order to run analysis in QGIS. The image on GEE had only one band: the calculted NDVI, but whenever I open it on QGIS I have 4 bands: NDVI and the RGB bands. I would like to have only one band in the image.

Is there any way to download only one band and not to have the rendered image?

This is an example for how I have download image that has only band 4 and band 8 and QA60, but when I opened it on QGIS I had also the RGB:

enter image description here

This is the code part the export the images:

for (var i in listOfNumbers) {
  var image = ee.Image(listOfImages.get(listOfNumbers[i]));
  var toexport=image.visualize({}).addBands(image);


//   // do what ever you need with image
  Map.addLayer(image, {}, i);
  Export.image.toDrive({
  image: toexport.toFloat(),
  description: i,
  scale:20,
  crs:'EPSG:4326',
  //maxPixels:1310361348,
  region:geometry.geometry().bounds()

});


}
  • 1
    Please show the Earth Engine code you used to download the image. An image export should not contain bands that weren't present in the input image, but some operations do create "visualization" RGB bands. – Kevin Reid Jan 12 at 18:54
  • @Kevin Reid I have edit the question – Reut Jan 13 at 8:50
3

If you do not want RGB visualization bands, then you should not call image.visualize({}). The visualize algorithm creates RGB bands.

Simply replace image.visualize({}).addBands(image), which adds the original bands back to the visualization bands, with image. The toFloat will probably also be unneeded then.

for (var i in listOfNumbers) {
  var image = ee.Image(listOfImages.get(listOfNumbers[i]));
  Map.addLayer(image, {}, i);
  Export.image.toDrive({
    image: image,
    description: i,
    scale: 20,
    crs: 'EPSG:4326',
    region: geometry.geometry().bounds()
  });
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.