/edl-scripts/shp2tif.py

http://alageospatialportal.googlecode.com/ · Python · 15 lines · 11 code · 3 blank · 1 comment · 3 complexity · 6d52676ed52d3f19b4787582996bfd84 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 ".shp" in name:
  8. layername = name.replace(".shp","")
  9. print(layername)
  10. 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"
  11. print(command)
  12. os.system(command)