有6个频道的tif。要显示它,它需要一个栅格和一个兼容的栅格。如果通道多于3个,则仅涉及前三个通道。它设置了颜色间的颜色(红色,绿色,蓝色)。
Worldwind类GDALDataRaster,方法createCompatibleDataset(int width, int height, Sector sector, AVList destParams);
...
Driver drvMem = gdal.GetDriverByName("MEM");
int srcNumOfBands = this.dsVRT.getRasterCount();
Band srcBand1 = this.dsVRT.GetRasterBand(1);
int bandDataType = srcBand1.getDataType();
...
if (AVKey.INT16.equals(this.getValue(AVKey.DATA_TYPE)) && srcNumOfBands > 3){
destNumOfBands = 3; // ignore 4th band which is some kind of infra-red
}
...
Dataset ds = drvMem.Create("roi", width, height, destNumOfBands, bandDataType);
...
问题是,是否可以创建具有特定渠道(3,2,4)而不是前三个渠道的org.gdal.gdal.Dataset
?