Skip to content

Instantly share code, notes, and snippets.

@eightysteele
Created November 5, 2011 17:21
Show Gist options
  • Select an option

  • Save eightysteele/1341795 to your computer and use it in GitHub Desktop.

Select an option

Save eightysteele/1341795 to your computer and use it in GitHub Desktop.
import subprocess
import shlex
import glob
command = "gdal_translate -of GTiff %s %s.tif"
for bil in glob.glob('*.bil'):
subprocess.call(shlex.split(command % (bil, bil)))
import subprocess
import shlex
import glob
command = """gdalwarp -t_srs '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs' -s_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" %s %s-3857.bil"""
#command = "gdal_translate -of GTiff %s %s.tif"
for bil in glob.glob('*.bil'):
subprocess.call(shlex.split(command % (bil, bil)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment