]>
Commit | Line | Data |
---|---|---|
ad0a8c2d EB |
1 | #ifndef __VIKING_DEM_H |
2 | #define __VIKING_DEM_H | |
3 | ||
27d52569 | 4 | #define VIK_DEM_INVALID_ELEVATION -32768 |
ad0a8c2d EB |
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 | ||
70147e60 EB |
12 | #define VIK_DEM_VERT_METERS 1 /* wrong in 250k? */ |
13 | ||
14 | ||
ad0a8c2d EB |
15 | typedef struct { |
16 | guint n_columns; | |
17 | GPtrArray *columns; | |
18 | ||
70147e60 EB |
19 | guint8 horiz_units; |
20 | guint8 orig_vert_units; /* original, always converted to meters when loading. */ | |
ad0a8c2d EB |
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 ); | |
5ef1d57e | 48 | gint16 vik_dem_get_simple_interpol ( VikDEM *dem, gdouble east, gdouble north ); |
c81a5cd7 | 49 | gint16 vik_dem_get_shepard_interpol ( VikDEM *dem, gdouble east, gdouble north ); |
5ef1d57e | 50 | gint16 vik_dem_get_best_interpol ( VikDEM *dem, gdouble east, gdouble north ); |
ad0a8c2d EB |
51 | |
52 | void vik_dem_east_north_to_xy ( VikDEM *dem, gdouble east, gdouble north, guint *col, guint *row ); | |
53 | ||
54 | #endif |