Plotted time vs file size.
Plotted time vs file size.
Plotted time vs file size.
controls = applier.ApplierControls()
controls.setOutputDriverName('GTiff')
options = ['COMPRESS=LZW', 'BIGTIFF=YES', 'TILED=YES',
'INTERLEAVE=BAND',
'BLOCKXSIZE=256', 'BLOCKYSIZE=256']
controls.setCreationOptions(options)
controls.setWindowXsize(256)
controls.setWindowYsize(256)
median no. of seasons is 92 (66,105). Maximum possible is 112.
// assume all bands same size
nXSize = GDALGetRasterBandXSize( fifthPercentileBand );
nYSize = GDALGetRasterBandYSize( fifthPercentileBand );
printf("allocation size: %lu\n",
(unsigned long)nYSize* (unsigned long)nXSize*sizeof(uint8_t));
// Allocate space
pafScanline = (uint8_t *) CPLMalloc(nYSize*nXSize*sizeof(uint8_t));
dixScanline = (uint8_t *) CPLMalloc(nYSize*nXSize*sizeof(uint8_t));
refPixelScanline = (uint8_t *) CPLMalloc(nYSize*nXSize*sizeof(uint8_t));
/* and read the whole thing in */
GDALRasterIO(fifthPercentileBand , GF_Read, 0, 0, nXSize, nYSize,
pafScanline, nXSize, nYSize, GDT_Byte,
0, 0 );
GDALRasterIO(dixImageBand , GF_Read, 0, 0, nXSize, nYSize,
dixScanline, nXSize, nYSize, GDT_Byte,
0, 0 );
/* Create output */
hDstDS = GDALCreate( hDriver, pszDstFilename, nXSize, nYSize, 1, GDT_Byte,
papszOptions );
destBand = GDALGetRasterBand( hDstDS, 1 );
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
(Donald Knuth)