Releasing 0.9.1
[viking/gosmore.git] / src / dem.h
blob998ab088f1cdfa1a341314fa7783d9519efb4b3c
1 #ifndef __VIKING_DEM_H
2 #define __VIKING_DEM_H
4 #define VIK_DEM_INVALID_ELEVATION -32768
6 /* unit codes */
7 #define VIK_DEM_HORIZ_UTM_METERS 2
8 #define VIK_DEM_HORIZ_LL_ARCSECONDS 3
10 #define VIK_DEM_VERT_DECIMETERS 2
12 #define VIK_DEM_VERT_METERS 1 /* wrong in 250k? */
15 typedef struct {
16 guint n_columns;
17 GPtrArray *columns;
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;
24 gdouble min_east, min_north, max_east, max_north;
26 guint8 utm_zone;
27 gchar utm_letter;
28 } VikDEM;
30 typedef struct {
31 /* east-west coordinate for ALL items in the column */
32 gdouble east_west;
34 /* coordinate of northern and southern boundaries */
35 gdouble south;
36 // gdouble north;
38 guint n_points;
39 gint16 *points;
40 } VikDEMColumn;
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 );
47 gint16 vik_dem_get_east_north ( VikDEM *dem, gdouble east, gdouble north );
49 void vik_dem_east_north_to_xy ( VikDEM *dem, gdouble east, gdouble north, guint *col, guint *row );
51 #endif