Skip to content

Instantly share code, notes, and snippets.

@sanchangon
Created December 20, 2016 15:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanchangon/dcb49f7fbc525ccc43d756080c24d5f6 to your computer and use it in GitHub Desktop.
Save sanchangon/dcb49f7fbc525ccc43d756080c24d5f6 to your computer and use it in GitHub Desktop.
GDAL batch file
# Working
for %a in (*.tif) do gdal_translate -a_srs EPSG:4326 -of GTiff %a _%~na.tif
for %a in (*.tif) do gdalwarp -s_srs EPSG:4326 -of GTiff %a _%~na.tif
for %a in (*.tif) do gdalwarp %a mos_.tif
for %a in (*.ecw) do gdal_translate %a %~na.tif
for %a in (*shp) do ogr2ogr -t_srs EPSG:32647 %a %~na.shp
for %a in gdal_translate -a_srs EPSG:32647 -co COMPRESS=JPEG -co JPEG_QUALITY=75 -of GTiff %a _%~na.tif
for %a in (*.tif) do gdal_translate -a_srs EPSG:32647 -co COMPRESS=JPEG -co JPEG_QUALITY=75 -of GTiff %a %~na_.tif
# GDAL Enhance
gdalenhance -equalize -of "GTiff" -ot "BYTE" 5003609001.tif 5003609001_enh.tif
for %a in (*.tif) do gdalenhance -equalize -of GTiff -ot BYTE %a enh_%~na.tif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment