[Gdal-dev] Datatype of bands

Matt Hanson mhanson at photon.com
Fri Aug 18 14:53:25 EDT 2006


Hi,  I have a couple questions regarding the data type of bands in a single dataset.   Each spectral band in a file could potentially have a different datatype.  
 
1) Is there an easy way to retrieve the smallest data type that can hold the values across all bands, or only by iterating through with GetRasterband()->GetRasterDataType() and calls to GDALDataTypeUnion()?
 
2) It looks like GDAL cannot *create* a file with varying data types across spectral bands unless it is done with first a Create(), then using AddBands() to add each band individually.  But AddBands() isn't supported by all data formats.  I haven't been able to find a list of formats that support AddBand...did I miss it?
 
3) Not so much a GDAL question, but I was wondering how common users out there have found different datatypes vs. bands to be.  I don't think it's all that common unless perhaps elevation maps are bundled in with data, or the format contains both raw and calibrated data.  But I don't want to immediately make the assumption that all datasets will have identical datatypes across all bands. I need to make a decision about if I need to support creation of multi-datatype files and was hoping to get feedback on if users out there felt this was a safe assumption or a bad one.
 
Thanks in advance !
 
matt




More information about the Gdal-dev mailing list