I installed the "gdal-201-1800-core.msi" and "GDAL-2.1.2.win32-py3.4.msi" in WinPython. It looks like the gdal could run in python shell.( there is no error when type "import gdal" ). But I could not use any gdal function such as "GetRasterband()","ReadAsArray". what's wrong with the gdal?
import gdal
import ogr
file=gdal.Open(r'D:\GeoNE\temp\m2000049.tif')
band=file.GetRasterBand(1)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
----> 1 band=file.GetRasterband(1)
AttributeError: 'NoneType' object has no attribute 'GetRasterBand'
No comments:
Post a Comment