]> git.street.me.uk Git - andy/viking.git/blame - src/dem.h
Allow zoom to 1/32.
[andy/viking.git] / src / dem.h
CommitLineData
f6171fe3
EB
1/*
2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
3 *
4 * Copyright (C) 2003-2008, Evan Battaglia <gtoevan@gmx.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
ad0a8c2d
EB
22#ifndef __VIKING_DEM_H
23#define __VIKING_DEM_H
24
722b5481
RN
25G_BEGIN_DECLS
26
27d52569 27#define VIK_DEM_INVALID_ELEVATION -32768
ad0a8c2d
EB
28
29/* unit codes */
30#define VIK_DEM_HORIZ_UTM_METERS 2
31#define VIK_DEM_HORIZ_LL_ARCSECONDS 3
32
33#define VIK_DEM_VERT_DECIMETERS 2
34
70147e60
EB
35#define VIK_DEM_VERT_METERS 1 /* wrong in 250k? */
36
37
ad0a8c2d
EB
38typedef struct {
39 guint n_columns;
40 GPtrArray *columns;
41
70147e60
EB
42 guint8 horiz_units;
43 guint8 orig_vert_units; /* original, always converted to meters when loading. */
ad0a8c2d
EB
44 gdouble east_scale; /* gap between samples */
45 gdouble north_scale;
46
47 gdouble min_east, min_north, max_east, max_north;
48
49 guint8 utm_zone;
50 gchar utm_letter;
51} VikDEM;
52
53typedef struct {
54 /* east-west coordinate for ALL items in the column */
55 gdouble east_west;
56
57 /* coordinate of northern and southern boundaries */
58 gdouble south;
59// gdouble north;
60
61 guint n_points;
62 gint16 *points;
63} VikDEMColumn;
64
65
66VikDEM *vik_dem_new_from_file(const gchar *file);
67void vik_dem_free ( VikDEM *dem );
68gint16 vik_dem_get_xy ( VikDEM *dem, guint x, guint y );
69
70gint16 vik_dem_get_east_north ( VikDEM *dem, gdouble east, gdouble north );
5ef1d57e 71gint16 vik_dem_get_simple_interpol ( VikDEM *dem, gdouble east, gdouble north );
c81a5cd7 72gint16 vik_dem_get_shepard_interpol ( VikDEM *dem, gdouble east, gdouble north );
5ef1d57e 73gint16 vik_dem_get_best_interpol ( VikDEM *dem, gdouble east, gdouble north );
ad0a8c2d
EB
74
75void vik_dem_east_north_to_xy ( VikDEM *dem, gdouble east, gdouble north, guint *col, guint *row );
76
722b5481
RN
77G_END_DECLS
78
ad0a8c2d 79#endif