Ticket #3456 (closed defect: invalid)
GDAL/Python/Vista crashes with ReadAsArray(), ReadRaster()
| Reported by: | nono | Owned by: | hobu |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | PythonBindings | Version: | 1.6.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Hello,
I installed GDAL with Python bindings, and Python crashed wheh calling reading functions such as ReadAsArray?(), ReadRaster?().
I work on Windows Vista 32 bits with Python 2.6.2. I installed the GDAL Windows Binaries, I accordingly updated the PATH and created the GDAL_DATA environment variables, and I used the Windows installer GDAL-1.6.1.win32-py2.6.exe to set up Python bindings.
I can open datasets, read the projection, get a band, get the min-max values, etc. But, when I try to read the values with, e.g., band.ReadAsArray?() or band.ReadRaster?(), Python crashes.
Here is an example of code that crashes:
import gdal
from gdalconst import *
filename = ...
dataset = gdal.Open( filename, GA_ReadOnly )
band = dataset.GetRasterBand(1)
print 'Band Type=',gdal.GetDataTypeName(band.DataType)
min = band.GetMinimum()
max = band.GetMaximum()
gdal.AllRegister()
# no problem until here
array = band.ReadAsArray(0,0,1,1)
# and there Python crashes!
