Project

General

Profile

Download (2.14 KB) Statistics
| Branch: | Revision:
1
# 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
# Created on 08-Jun-2011
25

    
26
# at the time of script creation, these paths were correct on vulcan
27
export ASTDIR="/home/reeves/active_work/EandO/asterGdem"
28
export SRTMDIR="/home/reeves/active_work/EandO/CgiarSrtm/SRTM_90m_ASCII_4_1"
29

    
30
# SRTM (also convert to 16bit integer)
31
gdalbuildvrt srtm.vrt $SRTMDIR/srtm_*_01.asc
32
gdalwarp -ot Int16 -te -136 59.875 -96 60 -ts 48000 150 -r bilinear \
33
  srtm.vrt srtm_150below.tif
34

    
35
# ASTER
36
gdalbuildvrt aster.vrt $ASTDIR/ASTGTM_N59*W*_dem.tif \
37
  $ASTDIR/ASTGTM_N60*W*_dem.tif
38
gdalwarp -te -136 59.875 -96 60 -ts 48000 150 -r bilinear \
39
  aster.vrt aster_150below.tif
40
gdalwarp -te -136 60 -96 60.125 -ts 48000 150 -r bilinear \
41
  aster.vrt aster_150above.tif
42

    
43
# note that the top 150 rows of this one are, somewhat surprisingly,
44
# slightly different from the above!
45
# gdalwarp -te -136 59.875 -96 60.125 -ts 48000 300 -r bilinear \
46
#   aster.vrt aster_300straddle.tif
47
#
48
# and this yields an even different set of values
49
# gdalbuildvrt aster_N60.vrt $ASTDIR/ASTGTM_N60*W*_dem.tif
50
# gdalwarp -te -136 60 -96 60.125 -ts 48000 150 -r bilinear \
51
#   aster_N60.vrt aster_150above.tif
52

    
(1-1/6)