how GetRasterBand(1).ReadAsArray() give me zero

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how GetRasterBand(1).ReadAsArray() give me zero

Foguy
This post has NOT been accepted by the mailing list yet.
Hi, please i am new in GDAL. I use landsat image in classification but i apply these code line band data just give me 0. i don,t understand.

raster_dataset = gdal.Open('LC81850552017065LGN00_B3.tif', gdal.GA_ReadOnly)
geo_transform = raster_dataset.GetGeoTransform()
proj = raster_dataset.GetProjectionRef()
bands_data = []
for b in range(1, raster_dataset.RasterCount+1):
    band = raster_dataset.GetRasterBand(b)
    bands_data.append(band.ReadAsArray())

bands_data = np.dstack(bands_data)

Please i need help.
thank you
Loading...