http://www.worldclim.org/current
wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/tmin_30s_bil.zip
wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/tmax_30s_bil.zip
wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/tmean_30s_bil.zip
wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/prec_30s_bil.zip
unzip tmin_30s_bil.zip
unzip tmax_30s_bil.zip
unzip tmean_30s_bil.zip
unzip prec_30s_bil.zip
mkdir tmp
mkdir clouded
for i in *.bil; do
base=`basename $i .bil`
gdalwarp -co TILED=YES -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 -co COMPRESS=LZW -co ZLEVEL=9 -co TFW=NO $i tmp/$base.tif
gdaladdo -r nearest tmp/$base.tif 2 4 8 16 32
gdal_translate -co TILED=YES -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 -co COMPRESS=LZW -co ZLEVEL=9 -co TFW=NO -co COPY_SRC_OVERVIEWS=YES tmp/$base.tif clouded/$base.tif
rm tmp/$base.tif
done
rmdir tmp