[Gdal-dev] how to set block size

Andrey Kiselev dron at ak4719.spb.edu
Fri Jan 16 01:20:50 EST 2004


On Thu, Jan 15, 2004 at 11:16:52PM -0600, Pushkar Pradhan wrote:
> I would like to set the block size of any TIFF image that I'm writing.
> I'm not trying any fancy stuff, I just want to set it to the same
> block size as my input image.
> I couldn't find any setblocksize methods?

Pssibility to set block sizes depends from the choosen driver. For TIFF
you can select stripped or tiled scheme and ajust size of strips or
tiles with the BLOCKXSIZE and BLOCKYSIZE creation options.

It will be something like:

	char **papszOptions = NULL;

	papszOptions = CSLSetNameValue(papszOptions, "TILED", "YES");
	papszOptions = CSLSetNameValue(papszOptions, "BLOCKXSIZE", "256");

	Create(pszName, nXSize, nYSize, nBands, eType, papszOptions);

	CSLDestroy(papszOptions);

-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517



More information about the Gdal-dev mailing list