Hello,

I am trying to transpose image data (i.e., swap lines and columns) and am struggling to make it work properly. I think this should be possible through RasterIO, but so far no luck. Any suggestions?

My approach so far has been like this, with image nXsize by nYsize:

void *pData = VSIMalloc2(nXSize, (GDALGetDataTypeSize(eType) / 8));

for (int iLine = 0; iLine < nYSize; iLine++) {

   // Read in row (line)
   eErr = poSrcBand->RasterIO(GF_Read, 0, iLine, nXSize, 1, pData,
                                        nXSize, 1, eType, 0,0);

  // Now I want to write a column, nothing I tried here has worked
   eErr = poDstBand->RasterIO(GF_Write, .......



}
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to