Skip to content

Instantly share code, notes, and snippets.

@MateoV
Created February 4, 2014 19:32
Show Gist options
  • Save MateoV/8810641 to your computer and use it in GitHub Desktop.
Save MateoV/8810641 to your computer and use it in GitHub Desktop.
Script to split a Mexico 15m DEM file into smaller chunks
#!/bin/bash
set -e -u
width=218763
height=130943
y=0
while [ $y -lt $height ]
do
x=0
while [ $x -lt $width ]
do
outtif=t_${y}_$x.tif
gdal_translate -srcwin $x $y 10000 10000 -co compress=lzw CEM3.0_R15m.bil mexico/${outtif}
let x=$x+10000
done
let y=$y+10000
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment