Raster Data as Array with GDAL

# File Dem
rst = "/home/percyelbis/Downloads/UTM_PTL_WIN/rst/AP.tif"

# Import Library.
import gdal

dem = gdal.Open(rst)

# Information about the dem
print("Projection is {}".format(dem.GetProjection()))

# View as array

band1 = dem.GetRasterBand(1).ReadAsArray()
print(band1.shape)
print(band1.max())
print(band1.mean())
print(band1.min())

Popular posts from this blog

How to fill gaps in SLC-Off Landsat 7 ETM+ Images with QGIS?