[gdal-dev] Change of behavior ?? GDALRasterBand:IReadBlock vs RasterIO ?

asmita asmitawankhede at gmail.com
Wed Feb 1 10:55:41 PST 2017


I implemented the IReadBlock, still same issue with the WarpOperation  ( that
is the code path I am hitting essentially). The issue I see now is the warp
does miss some band info or something happens that the entire mosaic is
black instead of the imagery. Note that these are non pallette imageries :

implementation:

CPLErr XYZRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, void
*pImage) {


    int nXOff = nBlockXOff * nBlockXSize,
        nYOff = nBlockYOff * nBlockYSize,
        nXSize = nBlockXSize,
        nYSize = nBlockYSize;

    if( nXOff + nXSize > nRasterXSize )
        nXSize = nRasterXSize - nXOff;
    if( nYOff + nYSize > nRasterYSize )
        nYSize = nRasterYSize - nYOff;

    int nPixelSpace = GDALGetDataTypeSize(eDataType) / 8;
    int nLineSpace = nPixelSpace * nBlockXSize;

    GDALRasterIOExtraArg sExtraArg;
    INIT_RASTERIO_EXTRA_ARG(sExtraArg);
   
    return IRasterIO(GF_Read,
                    nXOff, nYOff, nXSize, nYSize,
                    pImage, nXSize, nYSize,
                    eDataType, nPixelSpace, nLineSpace, &sExtraArg);
    
}

WarpOperation : region to buffer call:

void
xyzGDALWarpingReader::FetchPixels(const xyzExtents<uint32> &srcExtents)
{
  warpOperation.WarpRegionToBuffer(srcExtents.beginX(),
                                       srcExtents.beginY(),
                                       srcExtents.width(),
                                       srcExtents.height(),
                                       &rawReadBuf[0],
                                       gdalDatatype
                               );
  }
}

srcExtents acts as a destination buffer for whatever reason in the codebase,
and it used to work for GDAL 1.1



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Change-of-behavior-GDALRasterBand-IReadBlock-vs-RasterIO-tp5305401p5305837.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list