]> git.mxchange.org Git - flightgear.git/blob - DemRaw2ascii/rawdem.h
Added trisegs.[ch]xx tripoly.[ch]xx.
[flightgear.git] / 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  * (Log is kept at end of this file)
23  */
24
25
26 #ifndef _RAWDEM_H
27 #define _RAWDEM_H
28
29
30 #define MAX_ROWS 6000
31 #define MAX_COLS 7200
32 #define MAX_COLS_X_2 14400
33
34 typedef struct {
35     /* header info */
36     int nrows;       /* number of rows */
37     int ncols;       /* number of cols */
38     int ulxmap;      /* X coord of center of upper left pixel in arcsec */
39     int ulymap;      /* Y coord of center of upper left pixel in arcsec */
40     int rootx;       /* X coord of upper left *edge* of DEM region in degrees */
41     int rooty;       /* Y coord of upper left *edge* of DEM region in degrees */
42     int xdim;        /* X dimension of a pixel */
43     int ydim;        /* Y dimension of a pixel */
44     int tmp_min;     /* current 1x1 degree tile minimum */
45     int tmp_max;     /* current 1x1 degree tile maximum */
46
47     /* file ptr */
48     int fd;          /* Raw DEM file descriptor */
49
50     /* storage area for a 1 degree high strip of data.  Note, for
51      * convenience this is in y,x order */
52     short strip[120][MAX_ROWS];
53
54     short center[120][120];  /* tile with data taken at center of pixel */
55     float edge[121][121];    /* tile with data converted to corners */
56 } fgRAWDEM;
57
58
59 /* Read the DEM header to determine various key parameters for this
60  * DEM file */
61 void rawReadDemHdr( fgRAWDEM *raw, char *hdr_file );
62
63 /* Open a raw DEM file. */
64 void rawOpenDemFile( fgRAWDEM *raw, char *raw_dem_file );
65
66 /* Close a raw DEM file. */
67 void rawCloseDemFile( fgRAWDEM *raw );
68
69 /* Read a horizontal strip of (1 vertical degree) from the raw DEM
70  * file specified by the upper latitude of the stripe specified in
71  * degrees.  The output the individual ASCII format DEM tiles.  */
72 void rawProcessStrip( fgRAWDEM *raw, int lat_degrees, char *path );
73
74
75 #endif /* _RAWDEM_H */
76
77
78 /* $Log$
79 /* Revision 1.2  1998/03/03 13:10:30  curt
80 /* Close to a working version.
81 /*
82  * Revision 1.1  1998/03/02 23:31:02  curt
83  * Initial revision.
84  *
85  */