Get Raster Properties
from osgeo import gdal fn_dem = r"..\data\input\USGS_one_meter_x64y486_ID_FEMAHQ_2018.tif" fn_img = r"..\data\input\m_4311515_ne_11_1_20150908_20160104.jp2" ds = gdal.Open(fn_dem) # 2 arguments: (file name, access type: 0 (default) read-only, 1 update) nrows = ds.RasterYSize ncols = ds.RasterXSize proj = ds.GetProjection() # returns WKT definition nbands = ds.RasterCount geot = ds.GetGeoTransform()