Answers:
gdal.GetDriverCount()
将提供具有的驱动程序数量gdal
。结合简单的循环,可以列出所有驱动程序。
import gdal
driver_list = []
for i in range(gdal.GetDriverCount()):
driver = gdal.GetDriver(i)
driver_list.append(driver.GetDescription())
# list comprehension
driver_list = [gdal.GetDriver(i).GetDescription() for i in range(gdal.GetDriverCount())]
# to get name as string
gdal.GetDriver(i).ShortName