PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/edl-scripts/tif2bil.py

http://alageospatialportal.googlecode.com/
Python | 17 lines | 15 code | 1 blank | 1 comment | 6 complexity | eb1e93fd90f42bba03d0f60f643375fe 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 ".tif" in name:
 9			layername = name.replace(".tif","")
10			print(layername)		
11		#	os.system(edlconfig.gdalapps+"/gdal_translate -of EHdr " + os.path.join(root,name) + " "  + os.path.join(root,layername) + ".bil")
12			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"
13
14			print(command)
15			os.system(command)
16			
17