[gdal-dev] GDAL 1.11.0 and Cosmo-skymed L1A imagery

vf victor.fomin.1 at gmail.com
Fri Feb 6 03:32:22 PST 2015


Thank you for the reply, Even

I agree that the patch was firstly to handle correctly dimensions of h5
files : previously it was [width, height, 2] -> nbBands = width. Using
patch, dimensions were correctly interpreted. However, the patch contained
the following code to handle complex data type (see below). Am I
misunderstand something ? 

If I would like to contribute, should I submit a patch to the tracker or
someting else to do ...



/************************************************************************/
/*                            GetDataType()                             */
/*                                                                      */
/*      Transform HDF5 datatype to GDAL datatype                        */
/************************************************************************/

/**
 * Retrieves data type taking to account that file can be CSK Product with
 * complex data
 */
GDALDataType HDF5ImageDataset::GetDataType(hid_t TypeID)
{
    GDALDataType dataType = HDF5Dataset::GetDataType(TypeID);
    if (iSubdatasetType == CSK_PRODUCT)
    {
        // if has 3 dimensions -> complex imagery
        if (ndims == 3)
        {
            if( dataType == GDT_Int16 )
                return GDT_CInt16;
            else if( dataType == GDT_Int32 )
                return GDT_CInt32;
            else if( dataType == GDT_Float32 )
                return GDT_CFloat32;
            else if( dataType == GDT_Float64 )
                return GDT_CFloat64;
        }
    }
    return dataType;
}


/************************************************************************/
/*                          GetDataTypeName()                           */
/*                                                                      */
/*      Return the human readable name of data type                     */
/************************************************************************/

/**
 * Retrieves data type name taking to account that file can be CSK Product
with
 * complex data
 */
const char *HDF5ImageDataset::GetDataTypeName(hid_t TypeID)
{
    GDALDataType dataType = HDF5Dataset::GetDataType(TypeID);
    if (iSubdatasetType == CSK_PRODUCT)
    {
        // if has 3 dimensions -> complex imagery
        if (ndims == 3)
        {
            if( dataType == GDT_Int16 )
                return "Complex 16-bit integer";
            else if( dataType == GDT_Int32 )
                return "Complex 32-bit integer";
            else if( dataType == GDT_Float32 )
                return "Complex 32-bit floating-point";
            else if( dataType == GDT_Float64 )
                return "Complex 64-bit floating-point";
        }
    }

    const char * name = HDF5Dataset::GetDataTypeName( TypeID );
    return name;
}




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/GDAL-1-11-0-and-Cosmo-skymed-L1A-imagery-tp5185900p5185945.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list