[gdal-dev] Question about GDALDataType::GDT_Float32
Adeel Raza
adeel.raza at crc.gc.ca
Fri Jul 10 17:31:44 EDT 2009
Hi,
Thanks for the quick reply Frank.
Frank Warmerdam wrote:
> Adeel Raza wrote:
>> Hi,
>>
>> I'm using the GDALRasterBand::RasterIO() function to write a buffer
>> of C/C++ float types to a raster band of data type
>> GDALDataType::GDT_Float32. I assumed that this conversion would not
>> be problem since the size of a C/C++ float is also 32 bits, but I
>> wanted to be sure. If the conversion will be problematic, how would I
>> resolve the issue (ex: a potential cast maybe).
>
> Adeel,
>
> There is no problem. The GDT_Float32 enumeration value refers to the
> normal 32bit system "float" type in C/C++.
>
> I would add that you should expect, and provide float's in native
> machine order. GDAL will take care of byte swapping during io if
> needed.
>
> Best regards,
More information about the gdal-dev
mailing list