GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
interpf.h
Go to the documentation of this file.
1
/*
2
* modified by Brown in June 1999 - added elatt & smatt
3
* modified by Mitasova Nov. 9, 1999 - added parameter for dtens to output2d
4
*/
5
#include <grass/Vect.h>
6
#include <grass/bitmap.h>
7
#include <grass/dataquad.h>
8
#include <grass/qtree.h>
9
#include <grass/dbmi.h>
10
11
/* for resample program */
12
struct
fcell_triple
13
{
14
double
x
;
15
double
y
;
16
FCELL
z
;
17
double
smooth
;
18
};
19
20
#ifdef POINT2D_C
21
struct
line_pnts *
Pnts
;
22
struct
line_cats *
Cats2
;
23
dbDriver *
driver2
;
24
dbString
sql2
;
25
struct
Map_info
Map2
;
26
struct
field_info *
ff
;
27
int
count
;
28
#else
29
extern
struct
line_pnts *
Pnts
;
30
extern
struct
line_cats *
Cats2
;
31
extern
dbDriver *
driver2
;
32
extern
dbString
sql2
;
33
extern
struct
Map_info
Map2
;
34
extern
struct
field_info *
ff
;
35
extern
int
count
;
36
#endif
37
38
struct
interp_params
39
{
40
double
zmult
;
/* multiplier for z-values */
41
FILE *
fdinp
;
/* input stream */
42
int
elatt
;
/* which floating point attr to use? first = 1, second = 2, etc */
43
int
smatt
;
/* which floating point attr to use for smoothing? first = 1, second = 2, etc */
44
int
kmin
;
/* min number of points per segment for interpolation */
45
int
kmax
;
/* max number of points per segment */
46
char
*
maskmap
;
/* name of mask */
47
int
nsizr
,
nsizc
;
/* number of rows and columns */
48
DCELL *
az
, *
adx
, *
ady
, *
adxx
, *
adyy
, *
adxy
;
/* array for interpolated values */
49
double
fi
;
/* tension */
50
int
KMAX2
;
/* max num. of points for interp. */
51
int
scik1
,
scik2
,
scik3
;
/* multipliers for interp. values */
52
double
rsm
;
/* smoothing */
53
char
*
elev
, *
slope
, *
aspect
, *
pcurv
, *
tcurv
, *
mcurv
;
/* output files */
54
double
dmin
;
/* min distance between points */
55
double
x_orig
,
y_orig
;
/* origin */
56
int
deriv
,
cv
;
/* 1 if compute partial derivs */
57
double
theta
;
/* anisotropy angle, 0=East,counter-clockwise */
58
double
scalex
;
/* anisotropy scaling factor */
59
struct
TimeStamp *
ts
;
/* timestamp for raster files */
60
FILE *
Tmp_fd_z
, *
Tmp_fd_dx
, *
Tmp_fd_dy
,
/* temp files for writing interp. */
61
*
Tmp_fd_xx
, *
Tmp_fd_yy
, *
Tmp_fd_xy
;
/* values */
62
FILE *
fddevi
;
/* pointer to deviations file */
63
64
int (*
grid_calc
) ();
/*calculates grid for given segm */
65
int (*
matrix_create
) ();
/*creates matrix for a given segm */
66
int (*
check_points
) ();
/*checks interp. func. at points */
67
int (*
secpar
) ();
/* calculates aspect,slope,curv. */
68
double (*
interp
) ();
/* radial based interp. function */
69
int (*
interpder
) ();
/* interp. func. for derivatives */
70
int (*
wr_temp
) ();
/* writes temp files */
71
char
*
wheresql
;
/* SQL statement to select input points */
72
};
73
74
/* distance.c */
75
double
IL_dist_square
(
double
*,
double
*,
int
);
76
77
/* func2d.c */
78
double
IL_crst
(
double
,
double
);
79
int
IL_crstg
(
double
,
double
,
double
*,
double
*);
80
81
/* init2d.c */
82
void
IL_init_params_2d
(
struct
interp_params
*, FILE *,
int
,
int
,
double
,
83
int
,
int
,
char
*,
int
,
int
,
84
DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *,
85
double
,
int
,
int
,
int
,
int
,
double
,
86
char
*,
char
*,
char
*,
char
*,
char
*,
char
*,
87
double
,
double
,
double
,
int
,
double
,
double
,
88
FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *,
89
struct
TimeStamp *,
int
,
char
*);
90
91
void
IL_init_func_2d
(
struct
interp_params
*,
int
(*)(),
int
(*)(),
int
(*)(),
92
int
(*)(),
double
(*)(),
int
(*)(),
int
(*)());
93
/* input2d.c */
94
int
IL_input_data_2d
(
struct
interp_params
*,
struct
tree_info
*,
double
*,
95
double
*,
double
*,
double
*,
double
*,
double
*,
int
*);
96
struct
BM *
IL_create_bitmask
(
struct
interp_params
*);
97
int
translate_quad
(
struct
multtree
*,
double
,
double
,
double
,
int
);
98
99
/* interp2d.c */
100
int
IL_grid_calc_2d
(
struct
interp_params
*,
struct
quaddata
*,
struct
BM *,
101
double
,
double
,
double
*,
double
*,
double
*,
double
*,
102
double
*,
double
*,
double
*,
double
*,
double
*,
103
double
*,
int
,
double
);
104
/* matrix.c */
105
int
IL_matrix_create
(
struct
interp_params
*,
struct
triple
*,
int
,
double
**,
106
int
*);
107
/* minmax.c */
108
int
min1
(
int
,
int
);
109
int
max1
(
int
,
int
);
110
double
amax1
(
double
,
double
);
111
double
amin1
(
double
,
double
);
112
113
/* newsegm2d.c */
114
int
IL_interp_segments_new_2d
(
struct
interp_params
*,
struct
tree_info
*,
115
struct
multtree
*,
struct
BM *,
double
,
double
,
116
double
*,
double
*,
double
*,
double
*,
117
double
*,
double
*,
double
*,
double
*,
118
double
*,
int
,
int
,
double
);
119
/* output2d.c */
120
int
IL_output_2d
(
struct
interp_params
*,
struct
Cell_head *,
double
,
double
,
121
double
,
double
,
double
,
double
,
double
,
double
,
double
,
122
double
,
double
,
char
*,
double
,
int
,
int
,
int
);
123
/* point2d.c */
124
int
IL_check_at_points_2d
(
struct
interp_params
*,
struct
quaddata
*,
double
*,
125
double
*,
double
,
double
,
struct
triple
);
126
/* resout2d.c */
127
/* resout2dmod.c */
128
int
IL_resample_output_2d
(
struct
interp_params
*,
double
,
double
,
double
,
129
double
,
double
,
double
,
double
,
double
,
double
,
130
double
,
double
,
char
*,
double
*,
131
struct
Cell_head *,
struct
Cell_head *,
char
*,
132
int
);
133
/* ressegm2d.c */
134
int
IL_resample_interp_segments_2d
(
struct
interp_params
*,
struct
BM *,
135
double
,
double
,
double
*,
double
*,
136
double
*,
double
*,
double
*,
double
*,
137
double
*,
double
*,
double
*,
int
,
138
double
*,
int
,
int
,
int
,
int
,
int
,
double
,
139
double
,
double
,
double
,
int
);
140
/* secpar2d.c */
141
int
IL_secpar_loop_2d
(
struct
interp_params
*,
int
,
int
,
int
,
struct
BM *,
142
double
*,
double
*,
double
*,
double
*,
double
*,
143
double
*,
int
,
int
);
144
/* segmen2d.c */
145
int
IL_interp_segments_2d
(
struct
interp_params
*,
struct
tree_info
*,
146
struct
multtree
*,
struct
BM *,
double
,
double
,
147
double
*,
double
*,
double
*,
double
*,
double
*,
148
double
*,
double
*,
double
*,
double
*,
int
,
int
,
149
double
);
150
/* vinput2d.c */
151
int
IL_vector_input_data_2d
(
struct
interp_params
*,
struct
Map_info *,
int
,
152
char
*,
char
*,
struct
tree_info
*,
double
*,
153
double
*,
double
*,
double
*,
double
*,
double
*,
154
int
*,
double
*);
155
int
process_point
(
double
,
double
,
double
,
double
,
struct
tree_info
*,
double
,
156
double
*,
double
*,
double
*,
double
*,
double
*,
double
*,
157
int
*,
int
*,
int
*);
158
/* write2d.c */
159
int
IL_write_temp_2d
(
struct
interp_params
*,
int
,
int
,
int
);
lib
rst
interp_float
interpf.h
Generated on Thu Sep 26 2013 09:48:03 for GRASS Programmer's Manual by
1.8.4