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