[gdal-dev] VRT Plugin

Yves Jacolin yjacolin at free.fr
Mon Jan 9 11:50:02 EST 2012


Hello,

I get this error with one of my function of my vrt plugins:

Band 1 Block=128x128 Type=Float32, ColorInterp=Undefined
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: IReadBlock failed at X offset 1, Y offset 0
ERROR 1: IReadBlock failed at X offset 0, Y offset 1
ERROR 1: IReadBlock failed at X offset 1, Y offset 1
ERROR 1: IReadBlock failed at X offset 0, Y offset 2
ERROR 1: IReadBlock failed at X offset 1, Y offset 2
ERROR 1: Failed to compute min/max, no valid pixels found in sampling.


This function is:
CPLErr waveDirToUFunc(void **papoSources, int nSources, void *pData,
                    int nXSize, int nYSize,
                    GDALDataType eSrcType, GDALDataType eBufType,
                    int nPixelSpace, int nLineSpace)
{
    int iLine, iCol, ii;
    double pix_val;
    double x0;
    
    /* ---- Init ---- */
    if (nSources < 2) return CE_Failure;

    /* ---- Set pixels ---- */
    if (GDALDataTypeIsComplex( eSrcType ))
    {
        /*double adfPixVal[2], dfOldR, dfOldI, dfNewR, dfNewI;*/
        /*void *pReal, *pImag;*/
        /*int nOffset = GDALGetDataTypeSize( eSrcType ) / 8 / 2;*/

        /* ---- Set pixels ---- */
        for( iLine = 0, ii= 0; iLine < nYSize; ++iLine ) {
            for( iCol = 0; iCol < nXSize; ++iCol, ++ii ) {
                x0 = SRCVAL(papoSources[0], eSrcType, ii);

                pix_val = cos(x0*0.1*PI/180);
            
                GDALCopyWords(&pix_val, GDT_Float64, 0,
                          ((GByte *)pData) + nLineSpace * iLine + iCol * 
nPixelSpace,
                          eBufType, nPixelSpace, 1);
            }
        }
    }
    /* ---- Return success ---- */
    return CE_None;
} /* waveDirToUFunc */

Data range value is 0 to 3600.

Any idea? Thanks,

Y.
-- 
Yves Jacolin

http://yjacolin.gloobe.org


More information about the gdal-dev mailing list