PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/edl-scripts/adf2tif.py

http://alageospatialportal.googlecode.com/
Python | 17 lines | 10 code | 2 blank | 5 comment | 8 complexity | 9436a0daec2447b29d3c096da5fd0930 MD5 | raw file
 1#!/usr/bin/python26
 2import os
 3import shutil
 4import edlconfig
 5#dataset = "/mnt/transfer/media/LaCie/datasets/DEM/"
 6#gdalapps = "/home/angus/gdal-1.7.2/apps"
 7
 8for root, dirs, files in os.walk(edlconfig.dataset):
 9	for dir in dirs:
10#		print(dir)
11		for name in os.listdir(os.path.join(root,dir)):
12			if "hdr.adf" in name:
13				layername = dir
14				print(layername)		
15#				os.system(edlconfig.gdalapps+"/gdal_translate -of GTiff " + os.path.join(root,dir,name) + " "  + os.path.join(root,layername) + ".tif")
16				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")
17