3 * Written by Curtis Olson, started February 1998.
5 * Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * (Log is kept at end of this file)
32 int main(int argc, char **argv) {
34 char basename[256], output_dir[256], hdr_file[256], dem_file[256];
35 int i, start_lat, end_lat;
38 printf("Usage: %s <input_file_basename> <output_dir>\n", argv[0]);
43 strcpy(basename, argv[1]);
46 strcpy(output_dir, argv[2]);
48 /* generate header file name */
49 strcpy(hdr_file, basename);
50 strcat(hdr_file, ".HDR");
52 /* generate input file name (raw dem) */
53 strcpy(dem_file, basename);
54 strcat(dem_file, ".DEM");
56 printf("Header file = %s Input file = %s\n", hdr_file, dem_file);
57 printf("Output Directory = %s\n", output_dir);
59 /* scan the header file and extract important values */
60 rawReadDemHdr(&raw, hdr_file);
62 /* open up the raw data file */
63 rawOpenDemFile(&raw, dem_file);
65 end_lat = raw.rooty / 3600;
66 start_lat = end_lat - ((raw.nrows * raw.ydim) / 3600);
67 printf("Latitude ranges from %d to %d\n", start_lat, end_lat);
69 for ( i = start_lat + 1; i <= end_lat; i++ ) {
70 rawProcessStrip(&raw, i, output_dir);
73 /* close the raw data file */
74 rawCloseDemFile(&raw);
81 /* Revision 1.3 1998/03/03 21:54:50 curt
82 /* Changes to process 30 arcsec binary DEM files.
84 * Revision 1.2 1998/03/03 13:10:28 curt
85 * Close to a working version.
87 * Revision 1.1 1998/03/02 23:31:01 curt