[gdal-dev] GDAL DataType class

Howard Butler hobu.inc at gmail.com
Wed Oct 28 12:48:28 EDT 2009


On Oct 28, 2009, at 11:35 AM, Frank Warmerdam wrote:

> Luca Fasano wrote:
>> Hi all,
>> I need a way to retrieve a GDAL DataType (its code or its string  
>> name,
>> it's the same) starting from all information on it. Does it exist a
>> class or method to to this?
>> For example:
>> GdalDataType(nbits=32, float=True, Complex=True) -> gdal.GDT_CFloat32
>> I use Python bindings for GDAL.
>> I'd like to avoid building the string manually (i.e.
>> 'GDT_'+'C'+'Float'+'32')
>> Thanks
>
> Luca,
>
> No such function exists.

We could take a patch and apply it to the Python bindings if you were  
to provide it though.  That would be handy, especially if it were  
smart enough to throw exceptions for permutations that can't exist in  
GDAL.

Howard


More information about the gdal-dev mailing list