/edl-scripts/adf2tif.py
http://alageospatialportal.googlecode.com/ · Python · 17 lines · 10 code · 2 blank · 5 comment · 4 complexity · 9436a0daec2447b29d3c096da5fd0930 MD5 · raw file
- #!/usr/bin/python26
- import os
- import shutil
- import edlconfig
- #dataset = "/mnt/transfer/media/LaCie/datasets/DEM/"
- #gdalapps = "/home/angus/gdal-1.7.2/apps"
- for root, dirs, files in os.walk(edlconfig.dataset):
- for dir in dirs:
- # print(dir)
- for name in os.listdir(os.path.join(root,dir)):
- if "hdr.adf" in name:
- layername = dir
- print(layername)
- # os.system(edlconfig.gdalapps+"/gdal_translate -of GTiff " + os.path.join(root,dir,name) + " " + os.path.join(root,layername) + ".tif")
- os.system(edlconfig.gdalapps+"/gdalwarp -s_srs '" + edlconfig.s_srs + "' -t_srs '" + edlconfig.t_srs + "' -srcnodata \"-32768\" -dstnodata \"-32768\" -of GTiff " + os.path.join(root,dir,name) + " " + os.path.join(root,layername) + ".tif")