[gdal-dev] bus error writing geotiff with LZW
Bobby Braswell
rob.braswell at unh.edu
Wed Mar 12 23:03:34 EDT 2008
Hi,
I have been unable to write a 2400x2400, 7 band image using the
geotiff driver and LZW in GDAL/Python. The code is below (using random
ints just for testing), which dies with the message "bus error"
immediately after printing "band 6". If I reduce the number of bands
or the array dimensions then the error goes away. Likewise if I remove
the compression. Maybe someone could tell me if this is expected, or
if maybe what I'm doing just doesn't make sense? Thank you,
Rob Braswell
from osgeo import gdal
from osgeo.gdalconst import *
import numpy
FORMAT = 'GTiff'
DATATYPE = GDT_Int16
OPTIONS = ['COMPRESS=LZW']
outfile='foo.tif'
xsize = 2400
ysize = xsize
nbands = 7
driver = gdal.GetDriverByName(FORMAT)
f = driver.Create(outfile, xsize, ysize, nbands, DATATYPE, OPTIONS)
for i in range(nbands):
x = numpy.random.randint(0,1000,(xsize,ysize))
print "band",i+1
o = f.GetRasterBand(i+1)
o.WriteArray(x)
f = None
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080312/2cc3201c/attachment-0001.html
More information about the gdal-dev
mailing list