#!/bin/bash # # Simple shell script for building SDF files from SRTM files # downloaded to the same directory from ftp://e0srp01u.ecs.nasa.gov:21/srtm/version2/ # Inputs the terrain files such as "N42W082.hgt" # outputs SPLAT-compatible files such as "42:43:82:83.sdf" # See the official SPLAT documentation for setup details # # Written by Austin Wright, VE3NCQ January 29, 2009 # #****************************************************************************** # * # This program is free software; you can redistribute it and/or modify it * # under the terms of the GNU General Public License as published by the * # Free Software Foundation; either version 2 of the License or any later * # version. * # * # This program is distributed in the hope that it will useful, but WITHOUT * # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * # for more details. * # * #***************************************************************************** # This script converted the series from N40W074.hgt to N45W090.hgt # Change the "n" and "w" variables below to your own starting file # change the "for a" count to match the number of different lattitudes in .hgt files # change the "for b" count to match the number of different longitudes in .hgt files # don't miss any sections #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # place this script in the same directory as the srtm2sdf program included with SPLAT # make this script executable with chmod (chmod 777 makeSDF.sh) # the .hgt files should be in the same directory # don't run as root or the created files won't be accessible # move the files to the SPLAT working directory, or use the -d switch n=40 # the starting lattitude > change to the first lattitude in your .hgt sequence for a in 1 2 3 4 5 6 # the loop count, one for each lattitude in the .hgt files do w=74 # the starting longitude > change to the first longitude in your .hgt sequence for b in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # the loop count, one for each longitude in the .hgt file series do echo "N"$n"W0"$w".hgt" srtm2sdf "N"$n"W0"$w".hgt" let "w+=1" done let "n+=1" done exit 0 # hopefully this script will save somebody a few minutes of console time