![](/img/trans.png)
[英]Fastest way to extract all bands from raster at once (python/gdal)
[英]How to find the number of bands in gdal in python?
我正在使用代碼讀取tiff數據。
ds = 'path' , gdal.GA_ReadOnly)
我找到了gdal API,我找不到讀取樂隊的數量。
(ex)我有一個3波段圖像,然后讀取波段數,並返回3)
找到一些樂隊的方法是什么?
RasterCount屬性給出了波段數。 這是一個簡單的例子:
src_ds = gdal.Open("INPUT.tif")
if src_ds is not None:
print ("band count: " + str(src_ds.RasterCount))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.