Hello everyone how can I apply this function to all files in folder?
The function in question extracts the bands from a raster file (.ecw) and I would like to be able to do it to all the files in folder.
What should I do?
import gdal
in_path = "C:/gis_data/ECW"
out_path ="C:/gis_data/output"
src_ds = gdal.Open(in_path)
for i in range(1,src_ds.RasterCount+1):
out_ds = gdal.Translate(out_path + 'test' + str(i) + '.ecw', src_ds, format='GTiff', bandList=[i])
out_ds=None
Hello everyone how can I apply this function to all files in folder? The function in question extracts the bands from a raster file (.ecw) and I would like to be able to do it to all the files in folder. What should I do?