Opened 14 years ago
Closed 13 years ago
#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!
PS: on my OSGeo4W installation (which includes Python 2.5.2 and GDAL 1.5), the above script works perfectly.
I don't know if OSGeo4W installs some required dependency, or if this is a version-related bug (since my own installation is Python 2.6.2 and GDAL 1.6)...