summaryrefslogtreecommitdiff
path: root/ipl/gpacks/tiger/tgrmerge.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/gpacks/tiger/tgrmerge.icn')
-rw-r--r--ipl/gpacks/tiger/tgrmerge.icn59
1 files changed, 59 insertions, 0 deletions
diff --git a/ipl/gpacks/tiger/tgrmerge.icn b/ipl/gpacks/tiger/tgrmerge.icn
new file mode 100644
index 0000000..78942c6
--- /dev/null
+++ b/ipl/gpacks/tiger/tgrmerge.icn
@@ -0,0 +1,59 @@
+############################################################################
+#
+# File: tgrmerge.icn
+#
+# Subject: Program to merge line chain files
+#
+# Authors: Gregg M. Townsend and William S. Evans
+#
+# Date: June 9, 2000
+#
+############################################################################
+#
+# usage: tgrmerge file.lch ...
+#
+# Tgrmerge merges multiple line chain files to produce a single
+# output file.
+#
+############################################################################
+
+procedure main(args)
+ local f, fname, line, lat, lon
+ local minlat, maxlat, minlon, maxlon
+
+ if *args = 0 then
+ stop("usage: ", &progname, " file.lch ...")
+ minlat := minlon := 9999999
+ maxlat := maxlon := 0
+
+ every fname := !args do {
+ f := open(fname) | stop("can't open ", fname)
+ line := read(f) | stop("empty file: ", fname)
+ line ? {
+ move(8)
+ lon := move(7)
+ lat := move(7)
+ minlon >:= lon
+ minlat >:= lat
+ }
+ line := read(f) | stop("truncated file: ", fname)
+ line ? {
+ move(8)
+ lon := move(7)
+ lat := move(7)
+ maxlon <:= lon
+ maxlat <:= lat
+ }
+ close(f)
+ }
+
+ write(" ", right(minlon, 7), right(minlat, 7))
+ write(" ", right(maxlon, 7), right(maxlat, 7))
+ every fname := !args do {
+ f := open(fname) | stop("can't open ", fname)
+ read(f)
+ read(f)
+ while write(read(f))
+ close(f)
+ }
+end