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.
31 int main(int argc, char **argv) {
33 char basename[256], output_dir[256], hdr_file[256], dem_file[256];
34 int i, start_lat, end_lat;
37 printf("Usage: %s <input_file_basename> <output_dir>\n", argv[0]);
42 strcpy(basename, argv[1]);
45 strcpy(output_dir, argv[2]);
47 /* generate header file name */
48 strcpy(hdr_file, basename);
49 strcat(hdr_file, ".HDR");
51 /* generate input file name (raw dem) */
52 strcpy(dem_file, basename);
53 strcat(dem_file, ".DEM");
55 printf("Header file = %s Input file = %s\n", hdr_file, dem_file);
56 printf("Output Directory = %s\n", output_dir);
58 /* scan the header file and extract important values */
59 rawReadDemHdr(&raw, hdr_file);
61 /* open up the raw data file */
62 rawOpenDemFile(&raw, dem_file);
64 end_lat = raw.rooty / 3600;
65 start_lat = end_lat - ((raw.nrows * raw.ydim) / 3600);
66 printf("Latitude ranges from %d to %d\n", start_lat, end_lat);
68 for ( i = start_lat + 1; i <= end_lat; i++ ) {
69 rawProcessStrip(&raw, i, output_dir);
72 /* close the raw data file */
73 rawCloseDemFile(&raw);