/edl-scripts/bil2tif.py
Python | 16 lines | 14 code | 1 blank | 1 comment | 6 complexity | 2fe298af5b46335aab46bd33a15e72a4 MD5 | raw file
1#!/usr/bin/python 2import os 3import shutil 4import edlconfig 5 6for root, dirs, files in os.walk(edlconfig.dataset): 7 for name in files: 8 if ".BIL" in name: 9 layername = name.replace(".BIL","") 10 print(layername) 11 os.system(edlconfig.gdalapps+"/gdalwarp -s_srs '" + edlconfig.s_srs + "' -t_srs '" + edlconfig.t_srs + "' -srcnodata \"0\" -dstnodata \"-9999\" -of GTiff " + os.path.join(root,name) + " " + os.path.join(root,layername) + ".tif") 12# os.system(edlconfig.gdalapps+"/gdal_translate -of GTiff " + os.path.join(root,name) + " " + os.path.join(root,layername) + ".tif") 13 14 # os.system(edlconfig.gdalapps+"/gdalwarp -t_srs '" + edlconfig.t_srs + "' " + os.path.join(root,layername) + "GDA.tif " + os.path.join(root,layername) + ".tif") 15 16 # os.system("rm " + os.path.join(root,layername) + "GDA.tif")