[gdal-dev] GDAL slow to write GeoTIFF?
jramm
jamessramm at gmail.com
Mon Apr 27 07:55:24 PDT 2015
I'm writing a custom processing program using GDAL in C.
I'm processing a raster of roughly 150 000 * 200 000 pixels in windows of
256 * 256 pixels.
I'm finding that traversing the raster and applying some basic processing to
each of the windows takes very little time; about 10 minutes on my machine.
However, as soon as start writing out each window (to the same output raster
file), the time goes up to about 30 hours....
The writing is not special...just calling RasterIO like so:
<code>GDALRasterIO(wt->hBand, GF_Write, xOff, yOff, xSize, ySize, data,
xSize, ySize, GDT_UInt32, 0, 0);</code>
In a loop like so:
while (movingwindow_next(&win) == 0)
{
process(winsize, &dg, &cats, &bt, resultBuffer);
xOff = movingwindow_xoff();
yOff = movingwindow_yoff();
//writer_writeWindow(&wt, resultBuffer, win.sizeX, win.sizeY, xOff,
yOff);
}
...I would've expected the code to slow down by 2, 3 or even 4 times, but
300 times is a bit crazy, no?
Are their any techniques I can use to optimise writing?
I am also not particularly limited by the output format if geotiff is not
the most efficient. I am only constrained by the fact that ESRI ArcGIS must
be able to read it...
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/GDAL-slow-to-write-GeoTIFF-tp5203128.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
More information about the gdal-dev
mailing list