[Gdal-dev] RasterIO: replicating a value

Carlos A. Rueda carueda at ucdavis.edu
Wed Feb 16 14:47:52 EST 2005


Hello,

I'm trying to make only one call to RasterIO in a 1-band dataset
to fill a region with the same value. This is just an example:

GDALDataset* dataset = hDriver->Create(
    filename,
    1000,       //nXSize
    1000,       //nYSize
    1,          //nBands
    GDT_Int32,  //GDALDataType
    NULL        //papszParmList
);
int value = 1234;     // GDT_Int32 in my machine
dataset->RasterIO(
     GF_Write,
     0,   	   //nXOff,
     0,             //nYOff,
     200,           //nXSize,
     300,           //nYSize,
     &value,        //pData,
     1,             //nBufXSize,
     1,             //nBufYSize,
     GDT_Int32,     //eBufType,
     1,             //nBandCount,
     NULL,          //panBandMap,
     0,             //nPixelSpace,
     0,             //nLineSpace,
     0              //nBandSpace
);  	

Is this the right way to obtain the value replicated
200x300 times in the upper left region of the dataset?

Thanks!
Carlos




More information about the Gdal-dev mailing list