What are the possible reasons for this error?
Exported bands must have compatible data types; found inconsistent
types: UInt16 and UInt32
This is the code:
Map.addLayer(PuntoQuellaveco1);
Map.addLayer(operaciones);
Map.addLayer(Abast);
var image = ee.ImageCollection('COPERNICUS/S2')
.filterBounds(PuntoQuellaveco1)
.filterDate('2016-07-01','2016-08-31')
.sort('CLOUD_COVER', false);
var conteo = image.size();
print('conteo de imágenes', conteo);
var mejorImagen = ee.Image(image.sort('CLOUD_COVER').first());
print('La primera con menos nubosidad', mejorImagen);
Map.addLayer(mejorImagen, {bands: ['B4', 'B3', 'B2'], max: 3000}, 'image');
var fechaAdquirida = mejorImagen.get('DATE_ACQUIRED');
print('Fecha adquirida', fechaAdquirida);
Export.image.toDrive({
image: mejorImagen,
description: 'imageToDriveExample',
scale: 10,
region: Abast
});
The variables are already created, They just can't be copied because of this:
Best Answer
If you have a look at Sentinel 2 bands you'll find that all bands are type
unsigned int 16
except forQA20
that isunsigned int 32
, that band is causing the issue.You can solve it in different ways, but I post here what I think is what you need:
Or you could make
QA20
andunsigned int 16
to match the others: