Google Earth Engine(GEE)——Error: Exported bands must have compatible data types; found inconsistent

mistake:

Error: Exported bands must have compatible data types; found inconsistent types: Int16 and Byte. (Error code: 3) 

This question comes from the blog:

(400 messages) Google Earth Engine (GEE) - Extracting Buildings Using Normalized Building Index NDBI (Impermeable Layer)

Original download code:

//下载影像
Export.image.toDrive({
  image: scol_clip,
  description: '2011_sr',
  folder: 'training02',
  scale: 30,
  crs:'EPSG:4326',
  region:hh
});

 

 We see that this problem occurs when we run to this result: the result printed by scol_clip here is the image type, and the image we downloaded is a whole image, so it cannot be recognized. We need to improve the downloaded code. We can directly select the band we want to download and download, because each band is shaped, which solves the above problem.

Modified code:

//方法1不选择波段,全波段影像下载
Export.image.toDrive({
  image: scol_clip.select("NDBI").int16(),
  description: '2011_sr',
  folder: 'training02',
  scale: 30,
  crs:'EPSG:4326',
  region:hh
});

//方法2不选择波段,只选择NDBI波段,这样默认就是整形
Export.image.toDrive({
  image: scol_clip.select("NDBI"),
  description: '2011_sr',
  folder: 'training02',
  scale: 30,
  crs:'EPSG:4326',
  region:hh
});

 

Guess you like

Origin blog.csdn.net/qq_31988139/article/details/123908853