[Gdal-dev] how to write block by block to file

Pushkar Pradhan pushkar at GRI.MsState.Edu
Thu Jan 15 01:10:01 EST 2004


> Well, it is hard to be sure why it is seg faulting.  I would suggest
> running it in the debugger to at least determine where it faults!
Sorry not to tell that, it causes seg fault at this line:
  poDstDS = poDriver->Create(dwtFile, imgXSize, imgYSize, 1, GDT_Float32,
  NULL);

> However, your above code is likely to fail on partial right side, or
> bottom edge tiles/blocks if the file is actually tiled, rather than
> being using scanline blocks.
> Unless maximum performance is of the utmost importance, I would suggest
> simplifying this to read and write the data one scanline at a time.
I'm trying to parallelize my algorithms so I think I will try different read
sizes (e.g. tile vs. strips).
Doesn't GDAL handle it when you reach the right/bottom boundaries by
returning only valid data, I think libtiff does something like this, because
when I was using libtiff I used similar code.

Pushkar




More information about the Gdal-dev mailing list