1 |
3afd1c7b
|
Jim Regetz
|
# GDAL commands for assembling SRTM and ASTER DEM tiles associated with
|
2 |
|
|
# the 60N Canada boundary analysis, and resampling into the desired 3"
|
3 |
|
|
# (~90m) resolution even-boundary grid.
|
4 |
|
|
#
|
5 |
|
|
# These commands generate strips of elevation data (GeoTIFFs) along a
|
6 |
|
|
# 40-degree longitudinal extent matching (at least one of) Rick Reeves'
|
7 |
|
|
# mosaicked CDEM grids. The strips extend 150 pixels south of 60N and
|
8 |
|
|
# (in case of ASTER only) 150 pixels north of 60N, which should provide
|
9 |
|
|
# a sufficient but not excessive latitudinal range for fixing and
|
10 |
|
|
# assessing boundary artifacts.
|
11 |
|
|
#
|
12 |
|
|
# Note:
|
13 |
|
|
# Working with the original ASTERs yields this warning from GDAL:
|
14 |
|
|
# Warning 1: TIFFReadDirectoryCheckOrder:Invalid TIFF directory;
|
15 |
|
|
# tags are not sorted in ascending order
|
16 |
|
|
# I then ran gdal_translate on several of the offending ASTERs, then
|
17 |
|
|
# repeated the vrt/warp on those -- now without warnings. However, the
|
18 |
|
|
# output data was the same as when I operated on the original files
|
19 |
|
|
# (with warnings), so for the moment I'm just going to ignore the
|
20 |
|
|
# warnings.
|
21 |
|
|
#
|
22 |
|
|
# Jim Regetz
|
23 |
|
|
# NCEAS
|
24 |
|
|
|
25 |
|
|
# at the time of script creation, these paths were correct on vulcan
|
26 |
|
|
export ASTDIR="/home/reeves/active_work/EandO/asterGdem"
|
27 |
|
|
export SRTMDIR="/home/reeves/active_work/EandO/CgiarSrtm/SRTM_90m_ASCII_4_1"
|
28 |
|
|
|
29 |
|
|
# SRTM (also convert to 16bit integer)
|
30 |
|
|
gdalbuildvrt srtm.vrt $SRTMDIR/srtm_*_01.asc
|
31 |
|
|
gdalwarp -ot Int16 -te -136 59.875 -96 60 -ts 48000 150 -r bilinear \
|
32 |
|
|
srtm.vrt srtm_150below.tif
|
33 |
|
|
|
34 |
|
|
# ASTER
|
35 |
|
|
gdalbuildvrt aster.vrt $ASTDIR/ASTGTM_N59*W*_dem.tif \
|
36 |
|
|
$ASTDIR/ASTGTM_N60*W*_dem.tif
|
37 |
|
|
gdalwarp -te -136 59.875 -96 60 -ts 48000 150 -r bilinear \
|
38 |
|
|
aster.vrt aster_150below.tif
|
39 |
|
|
gdalwarp -te -136 60 -96 60.125 -ts 48000 150 -r bilinear \
|
40 |
|
|
aster.vrt aster_150above.tif
|
41 |
|
|
|
42 |
|
|
# note that the top 150 rows of this one are, somewhat surprisingly,
|
43 |
|
|
# slightly different from the above!
|
44 |
|
|
# gdalwarp -te -136 59.875 -96 60.125 -ts 48000 300 -r bilinear \
|
45 |
|
|
# aster.vrt aster_300straddle.tif
|
46 |
|
|
#
|
47 |
|
|
# and this yields an even different set of values
|
48 |
|
|
# gdalbuildvrt aster_N60.vrt $ASTDIR/ASTGTM_N60*W*_dem.tif
|
49 |
|
|
# gdalwarp -te -136 60 -96 60.125 -ts 48000 150 -r bilinear \
|
50 |
|
|
# aster_N60.vrt aster_150above.tif
|