1 /* rawdem.h -- library of routines for processing raw dem files (30 arcsec)
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 #define MAX_COLS_X_2 14400
35 int nrows; /* number of rows */
36 int ncols; /* number of cols */
37 int ulxmap; /* X coord of center of upper left pixel in arcsec */
38 int ulymap; /* Y coord of center of upper left pixel in arcsec */
39 int rootx; /* X coord of upper left *edge* of DEM region in degrees */
40 int rooty; /* Y coord of upper left *edge* of DEM region in degrees */
41 int xdim; /* X dimension of a pixel */
42 int ydim; /* Y dimension of a pixel */
43 int tmp_min; /* current 1x1 degree tile minimum */
44 int tmp_max; /* current 1x1 degree tile maximum */
47 int fd; /* Raw DEM file descriptor */
49 /* storage area for a 1 degree high strip of data. Note, for
50 * convenience this is in y,x order */
51 short strip[120][MAX_ROWS];
53 short center[120][120]; /* tile with data taken at center of pixel */
54 float edge[121][121]; /* tile with data converted to corners */
58 /* Read the DEM header to determine various key parameters for this
60 void rawReadDemHdr( fgRAWDEM *raw, char *hdr_file );
62 /* Open a raw DEM file. */
63 void rawOpenDemFile( fgRAWDEM *raw, char *raw_dem_file );
65 /* Close a raw DEM file. */
66 void rawCloseDemFile( fgRAWDEM *raw );
68 /* Read a horizontal strip of (1 vertical degree) from the raw DEM
69 * file specified by the upper latitude of the stripe specified in
70 * degrees. The output the individual ASCII format DEM tiles. */
71 void rawProcessStrip( fgRAWDEM *raw, int lat_degrees, char *path );
74 #endif /* _RAWDEM_H */