]> git.mxchange.org Git - flightgear.git/blob - Tools/Prep/DemRaw2ascii/rawdem.h
Fixed a small bug which cropped up with the new gpc hole interface.
[flightgear.git] / Tools / Prep / DemRaw2ascii / rawdem.h
1 /* rawdem.h -- library of routines for processing raw dem files (30 arcsec)
2  *
3  * Written by Curtis Olson, started February 1998.
4  *
5  * Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
6  *
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.
11  *
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.
16  *
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.
20  *
21  * $Id$
22  */
23
24
25 #ifndef _RAWDEM_H
26 #define _RAWDEM_H
27
28
29 #define MAX_ROWS 6000
30 #define MAX_COLS 7200
31 #define MAX_COLS_X_2 14400
32
33 typedef struct {
34     /* header info */
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 */
45
46     /* file ptr */
47     int fd;          /* Raw DEM file descriptor */
48
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];
52
53     short center[120][120];  /* tile with data taken at center of pixel */
54     float edge[121][121];    /* tile with data converted to corners */
55 } fgRAWDEM;
56
57
58 /* Read the DEM header to determine various key parameters for this
59  * DEM file */
60 void rawReadDemHdr( fgRAWDEM *raw, char *hdr_file );
61
62 /* Open a raw DEM file. */
63 void rawOpenDemFile( fgRAWDEM *raw, char *raw_dem_file );
64
65 /* Close a raw DEM file. */
66 void rawCloseDemFile( fgRAWDEM *raw );
67
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 );
72
73
74 #endif /* _RAWDEM_H */
75
76