diff --git a/get-datafiles-northamerica.sh b/get-datafiles-northamerica.sh deleted file mode 100755 index a425cb9..0000000 --- a/get-datafiles-northamerica.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# get the SRTM data files and convert them for splat use -# results in ~3.6 GB disk space consumed - -# License: Public domain / CC-0 - -# for state/county borders -- US only. -BORDERDIR=splat-datafiles/borders/ - -BORDERURL="https://web.archive.org/web/20130331144934/http://www.census.gov/geo/cob/bdy/co/co00ascii/co99_d00_ascii.zip" - -mkdir -p $BORDERDIR -cd $BORDERDIR -echo "retrieving state/county borders.." -wget -N -nv $BORDERURL -echo "unpacking state/county borders.." -unzip -o *.zip -cd - - -./get-datafiles.sh "North_America" - diff --git a/get-datafiles-world.sh b/get-datafiles-world.sh index f80c60e..e760935 100755 --- a/get-datafiles-world.sh +++ b/get-datafiles-world.sh @@ -1,12 +1,88 @@ #!/bin/sh +# get the SRTM data files and convert them for splat use + # License: Public domain / CC-0 -./get-datafiles-northamerica.sh -./get-datafiles.sh "South_America" -./get-datafiles.sh "Africa" -./get-datafiles.sh "Eurasia" -./get-datafiles.sh "Australia" -./get-datafiles.sh "Islands" +# path to topgraphy datafiles +TOPOFILEDIR=splat-datafiles/sdf/ +# local hgt file archive +HGTFILEDIR=splat-datafiles/hgtzip/ + +if [ ! -x `which srtm2sdf` ]; then + echo "error: not found in path: srtm2sdf splat conversion utility" + exit 1 +fi + +if [ ! -x `which readlink` ]; then + echo "error: not found in path: readlink" + exit 1 +fi + +if [ ! -x `which wget` ]; then + echo "error: not found in path: wget" + exit 1 +fi + +if [ ! -x `which unzip` ]; then + echo "error: not found in path: unzip" + exit 1 +fi + +if [ ! -x `which bzip2` ]; then + echo "error: not found in path: bzip2" + exit 1 +fi + +echo "Please sign up for a NASA Earthdata account at: \nhttps://urs.earthdata.nasa.gov/users/new" +read -p 'NASA Earthdata Username: ' NASA_USERNAME +read -sp 'NASA Earthdata Password: ' NASA_PASSWORD + +for PAGE in 1 2 3 4 5 6 +do + INDEXURL="https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL3.003/2000.02.11/SRTMGL3_page_$PAGE.html" + INDEXFILE=`mktemp` + + echo "getting index.." + wget -q -O - $INDEXURL | \ + sed -r -e '/hgt.zip\"/!d; s/.* ([NSWE0-9]+\.?hgt\.zip).*$/\1/; s/