PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/edl-scripts/shp2tif.py

http://alageospatialportal.googlecode.com/
Python | 15 lines | 13 code | 1 blank | 1 comment | 6 complexity | 6d52676ed52d3f19b4787582996bfd84 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 ".shp" in name:
 9			layername = name.replace(".shp","")
10			print(layername)		
11			command = "sudo " + edlconfig.gdalapps + "/gdal_rasterize -of GTiff -burn 1 -tr 0.01 0.01 -l " + layername + " " + os.path.join(root,name) + " " + os.path.join(root,layername) + ".tif"
12			print(command)
13			os.system(command)
14			
15