I am currently working on two-scan raster algorithms (euclidean distance transformations, cost surface analysis, etc.). Those algorithms require a line-wise forward raster scan (from top left to bottom right) as well as a backward/reversed raster scan (from bottom right to top left).
I am currently using GDAL to read the raster data using the C++ code provided by the tutorial.
float *pafScanline; int nXSize = poBand->GetXSize(); pafScanline = (float *) CPLMalloc(sizeof(float)*nXSize); poBand->RasterIO( GF_Read, 0, 0, nXSize, 1, pafScanline, nXSize, 1, GDT_Float32, 0, 0 );
RasterIo method reads the raster as scanlines into dynamically allocated memory (provided by
CPLMalloc) and it does so from left to right. Up to now I did not find any GDAL methods to read a raster scanline from right to left (eg. backwards).
My question: Is there any better method to achieve a backwards raster scan than reading the scanline from left to right and then reorder the values (which would mean that the scanline has to be processed twice)?