Skip to content

Instantly share code, notes, and snippets.

@jdherman
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save jdherman/a547c2c174a3b71b3c29 to your computer and use it in GitHub Desktop.

Select an option

Save jdherman/a547c2c174a3b71b3c29 to your computer and use it in GitHub Desktop.
clip raster data with shapefile example
#!/bin/bash
DIR=current
TYPE=tmean
RES=5m
pwd
for MONTH in {1..12}
do
gdalwarp -cutline states_shape/states.shp \
-crop_to_cutline -dstnodata "-9999.0" \
${DIR}/${TYPE}_${RES}/${TYPE}${MONTH}.bil \
${DIR}/${TYPE}_${RES}_usa/${TYPE}_${MONTH}.bil
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment