Skip to content

Instantly share code, notes, and snippets.

@jlehtoma
Created March 24, 2014 08:17
Show Gist options
  • Save jlehtoma/9736229 to your computer and use it in GitHub Desktop.
Save jlehtoma/9736229 to your computer and use it in GitHub Desktop.
Batch replace ASCII rasters with GeoTIFF rasters
#!/bin/bash
for FILE in *.asc
do
BASENAME=$(basename $FILE .asc)
OUTFILE=${BASENAME}.tif
echo "Processing: ${BASENAME}.asc"
gdal_translate -of GTiff -co COMPRESS=DEFLATE $FILE $OUTFILE
rm $FILE $FILE.*
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment