1
|
# download unzip and tif conversion of the Global Multi-resolution Terrain Elevation Data 2010 (GMTED2010)
|
2
|
# setting working directory
|
3
|
|
4
|
INDIR=/mnt/data2/dem_variables/GMTED2010
|
5
|
cd $INDIR
|
6
|
|
7
|
# download all the zip file from http://topotools.cr.usgs.gov/gmted_viewer/gmted2010_global_grids.php
|
8
|
# using multiprocess approch
|
9
|
url=http://gmted.cr.usgs.gov/gmted/Grid_ZipFiles/
|
10
|
echo $url"be75_grd.zip" $url"ds75_grd.zip" $url"md75_grd.zip" $url"mi75_grd.zip" $url"mn75_grd.zip" $url"mx75_grd.zip" $url"sd75_grd.zip" | xargs -n 1 -P 7 wget -d /mnt/data2/dem_variables/GMTED2010/zip/ $1
|
11
|
|
12
|
# unzip the file using multiprocess approch
|
13
|
|
14
|
ls /mnt/data2/dem_variables/GMTED2010/zip/*.zip | xargs -n 1 -P 7 bash -c $'
|
15
|
|
16
|
dir=`basename $1 .zip`
|
17
|
unzip -d /mnt/data2/dem_variables/GMTED2010/tiles/$dir $1
|
18
|
|
19
|
' _
|
20
|
|
21
|
# transform to tif and tiling them using multiprocess approch
|
22
|
# be75_grd.zip Breakline Emphasis , 7.5 arc-seconds
|
23
|
# ds75_grd.zip Systematic Subsample , 7.5 arc-seconds
|
24
|
# md75_grd.zip Median Statistic , 7.5 arc-seconds
|
25
|
# mi75_grd.zip Minimum Statistic , 7.5 arc-seconds
|
26
|
# mn75_grd.zip Mean Statistic , 7.5 arc-seconds
|
27
|
# mx75_grd.zip Maximum Statistic , 7.5 arc-seconds
|
28
|
# sd75_grd.zip Standard Dev. Statistic, 7.5 arc-seconds
|
29
|
|
30
|
echo be75_grd ds75_grd md75_grd mi75_grd mn75_grd mx75_grd sd75_grd | xargs -n 1 -P 7 bash -c $'
|
31
|
dir=$1
|
32
|
INDIR=/mnt/data2/dem_variables/GMTED2010/tiles/$dir
|
33
|
for nx in `seq 0 9` ; do
|
34
|
for ny in `seq 0 4` ; do
|
35
|
xoff=$(echo 17280 \* $nx | bc)
|
36
|
yoff=$(echo 13440 \* $ny | bc)
|
37
|
xsize=17280
|
38
|
ysize=13440
|
39
|
gdal_translate -srcwin $xoff $yoff $xsize $ysize -co COMPRESS=LZW $INDIR/$dir $INDIR"_tif"/$nx"_"$ny.tif
|
40
|
done
|
41
|
done
|
42
|
' _
|
43
|
|
44
|
# at the end fo this process the 50 tiles tiff has been created for each of the defined component
|