Imported Upstream version 1.1.0
[debian/splat] / utils / postdownload
1 #!/bin/bash
2 # Simple script for processing of downloaded undelimited gzipped
3 # USGS DEM files, and converting them to SPLAT Data Files.
4 # Written by John A. Magliacane, KD2BD May 2002
5 #
6 if [ $# == "0" ]; then
7         echo
8         echo "This utility reads downloaded gzipped USGS DEM"
9         echo "files and generates equivalent SPLAT Data Files (SDFs)."
10         echo
11         echo "Files compatible with this SPLAT! utility may be"
12         echo "obtained via anonymous ftp at:"
13         echo
14         echo -e "\tedcftp.cr.usgs.gov"
15         echo
16         echo "in the pub/data/DEM/250 subdirectory, or via http at:"
17         echo
18         echo -e "\tedcwww.cr.usgs.gov/glis/hyper/guide/1_dgr_dem#dem7"
19         echo
20         echo "Usage: postdownload wilmington-w.gz"
21         echo
22 else
23         # gunzip the downloaded file...
24         echo -n "Uncompressing $1..."
25         gunzip -c $1 > unzipped_file
26         echo
27         echo "Adding record delimiters..."
28         dd if=unzipped_file of=delimited_file ibs=4096 cbs=1024 conv=unblock
29         # Invoke usgs2sdf to generate a SPLAT Data File...
30         usgs2sdf delimited_file
31         echo -n "Removing temp files..."
32         rm delimited_file unzipped_file
33         echo
34         echo "Done!"
35 fi