/edl-scripts/tif2bil.py

http://alageospatialportal.googlecode.com/ · Python · 17 lines · 11 code · 4 blank · 2 comment · 3 complexity · eb1e93fd90f42bba03d0f60f643375fe MD5 · raw file

  1. #!/usr/bin/python
  2. import os
  3. import shutil
  4. import edlconfig
  5. for root, dirs, files in os.walk(edlconfig.dataset):
  6. for name in files:
  7. if ".tif" in name:
  8. layername = name.replace(".tif","")
  9. print(layername)
  10. # os.system(edlconfig.gdalapps+"/gdal_translate -of EHdr " + os.path.join(root,name) + " " + os.path.join(root,layername) + ".bil")
  11. command = edlconfig.gdalapps+"/gdalwarp -te 109.51 -44.37 157.28 -8.19 -tr 0.01 -0.01 -s_srs '" + edlconfig.s_srs + "' -t_srs '" + edlconfig.t_srs + "' -of EHdr -srcnodata -9999 -dstnodata -9999 " + os.path.join(root,layername) + ".tif " + os.path.join(root,layername) + ".bil"
  12. print(command)
  13. os.system(command)