]> git.street.me.uk Git - andy/viking.git/blob - src/dem.h
libgps is no more mandatory
[andy/viking.git] / src / dem.h
1 #ifndef __VIKING_DEM_H
2 #define __VIKING_DEM_H
3
4 #define VIK_DEM_INVALID_ELEVATION -32768
5
6 /* unit codes */
7 #define VIK_DEM_HORIZ_UTM_METERS 2
8 #define VIK_DEM_HORIZ_LL_ARCSECONDS  3
9
10 #define VIK_DEM_VERT_DECIMETERS 2
11
12 #define VIK_DEM_VERT_METERS 1 /* wrong in 250k?  */
13
14
15 typedef struct {
16   guint n_columns;
17   GPtrArray *columns;
18
19   guint8 horiz_units;
20   guint8 orig_vert_units; /* original, always converted to meters when loading. */
21   gdouble east_scale; /* gap between samples */
22   gdouble north_scale;
23
24   gdouble min_east, min_north, max_east, max_north;
25
26   guint8 utm_zone;
27   gchar utm_letter;
28 } VikDEM;
29
30 typedef struct {
31   /* east-west coordinate for ALL items in the column */
32   gdouble east_west;
33
34   /* coordinate of northern and southern boundaries */
35   gdouble south;
36 //  gdouble north;
37
38   guint n_points;
39   gint16 *points;
40 } VikDEMColumn;
41
42
43 VikDEM *vik_dem_new_from_file(const gchar *file);
44 void vik_dem_free ( VikDEM *dem );
45 gint16 vik_dem_get_xy ( VikDEM *dem, guint x, guint y );
46
47 gint16 vik_dem_get_east_north ( VikDEM *dem, gdouble east, gdouble north );
48
49 void vik_dem_east_north_to_xy ( VikDEM *dem, gdouble east, gdouble north, guint *col, guint *row );
50
51 #endif