GRASS GIS 8 Programmer's Manual 8.2.1(2023)-exported
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/config.h>
6#include <stdio.h>
7#include <grass/gis.h>
8#include <grass/raster.h>
9#include <grass/vector.h>
10#include <grass/bitmap.h>
11#include <grass/dataquad.h>
12#include <grass/qtree.h>
13#include <grass/dbmi.h>
14
15/* for resample program */
17{
18 double x;
19 double y;
20 FCELL z;
21 double smooth;
22};
23
24#ifdef POINT2D_C
25struct line_pnts *Pnts;
26struct line_cats *Cats2;
27dbDriver *driver2;
28dbString sql2;
29struct Map_info Map2;
30struct field_info *ff;
31int count;
32#else
33extern struct line_pnts *Pnts;
34extern struct line_cats *Cats2;
35extern dbDriver *driver2;
36extern dbString sql2;
37extern struct Map_info Map2;
38extern struct field_info *ff;
39extern int count;
40#endif
41
42struct interp_params;
43
44typedef int grid_calc_fn(
45 struct interp_params *, struct quaddata *, struct BM *,
46 double, double, double *, double *, double *, double *,
47 double *, double *, double *, double *, double *,
48 double *, off_t, double);
49
50typedef int matrix_create_fn(
51 struct interp_params *, struct triple *, int, double **, int *);
52
53typedef int check_points_fn(
54 struct interp_params *, struct quaddata *, double *,
55 double *, double, double, struct triple);
56
57typedef int secpar_fn(
58 struct interp_params *, int, int, int, struct BM *,
59 double *, double *, double *, double *, double *,
60 double *, int, int);
61
62typedef double interp_fn(double, double);
63
64typedef int interpder_fn(double, double, double *, double *);
65
66typedef int wr_temp_fn(struct interp_params *, int, int, off_t);
67
69{
70 double zmult; /**< multiplier for z-values */
71 FILE *fdinp; /**< input stream */
72 int elatt; /**< which floating point attr to use? first = 1, second = 2, etc */
73 int smatt; /**< which floating point attr to use for smoothing? first = 1, second = 2, etc */
74 int kmin; /**< min number of points per segment for interpolation */
75 int kmax; /**< max number of points per segment */
76 char *maskmap; /**< name of mask */
77 int nsizr, nsizc; /**< number of rows and columns */
78 DCELL *az, *adx, *ady,
79 *adxx, *adyy, *adxy; /**< array for interpolated values */
80 double fi; /**< tension */
81 int KMAX2; /**< max num. of points for interp. */
82 int scik1, scik2, scik3; /**< multipliers for interp. values */
83 double rsm; /**< smoothing */
84 char *elev, *slope, *aspect,
85 *pcurv, *tcurv, *mcurv; /**< output files */
86 double dmin; /**< min distance between points */
87 double x_orig, y_orig; /**< origin */
88 int deriv, cv; /**< 1 if compute partial derivs */
89 double theta; /**< anisotropy angle, 0=East,counter-clockwise */
90 double scalex; /**< anisotropy scaling factor */
91 struct TimeStamp *ts; /**< timestamp for raster files */
94 *Tmp_fd_yy, *Tmp_fd_xy; /**< temp files for writing interp. values */
95 bool create_devi; /**< create deviations file? */
96
97 grid_calc_fn *grid_calc; /**< calculates grid for given segm */
98 matrix_create_fn *matrix_create; /**< creates matrix for a given segm */
99 check_points_fn *check_points; /**< checks interp. func. at points */
100 secpar_fn *secpar; /**< calculates aspect,slope,curv. */
101 interp_fn *interp; /**< radial based interp. function */
102 interpder_fn *interpder; /**< interp. func. for derivatives */
103 wr_temp_fn *wr_temp; /**< writes temp files */
104 const char *wheresql; /**< SQL statement to select input points */
105};
106
107/* distance.c */
108double IL_dist_square(double *, double *, int);
109
110/* func2d.c */
111double IL_crst(double, double);
112int IL_crstg(double, double, double *, double *);
113
114/* init2d.c */
115void IL_init_params_2d(struct interp_params *, FILE *, int, int, double,
116 int, int, char *, int, int,
117 DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *,
118 double, int, int, int, int, double,
119 char *, char *, char *, char *, char *, char *,
120 double, double, double, int, double, double,
121 FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, bool,
122 struct TimeStamp *, int, const char *);
123
127/* input2d.c */
128int IL_input_data_2d(struct interp_params *, struct tree_info *, double *,
129 double *, double *, double *, double *, double *, int *);
130struct BM *IL_create_bitmask(struct interp_params *);
131int translate_quad(struct multtree *, double, double, double, int);
132
133/* interp2d.c */
134int IL_grid_calc_2d(struct interp_params *, struct quaddata *, struct BM *,
135 double, double, double *, double *, double *, double *,
136 double *, double *, double *, double *, double *,
137 double *, off_t, double);
138/* matrix.c */
139int IL_matrix_create(struct interp_params *, struct triple *, int, double **,
140 int *);
141int IL_matrix_create_alloc(struct interp_params *, struct triple *, int, double **,
142 int *, double *);
143/* minmax.c */
144int min1(int, int);
145int max1(int, int);
146double amax1(double, double);
147double amin1(double, double);
148
149/* newsegm2d.c */
151 struct multtree *, struct BM *, double, double,
152 double *, double *, double *, double *,
153 double *, double *, double *, double *,
154 double *, int, int, double);
155/* output2d.c */
156int IL_output_2d(struct interp_params *, struct Cell_head *, double, double,
157 double, double, double, double, double, double, double,
158 double, double, char *, double, int, int, int);
159/* point2d.c */
160int IL_check_at_points_2d(struct interp_params *, struct quaddata *, double *,
161 double *, double, double, struct triple);
162/* resout2d.c */
163/* resout2dmod.c */
164int IL_resample_output_2d(struct interp_params *, double, double, double,
165 double, double, double, double, double, double,
166 double, double, char *, double *,
167 struct Cell_head *, struct Cell_head *, char *,
168 int);
169/* ressegm2d.c */
170int IL_resample_interp_segments_2d(struct interp_params *, struct BM *,
171 double, double, double *, double *,
172 double *, double *, double *, double *,
173 double *, double *, double *, off_t,
174 double *, int, int, int, int, int, double,
175 double, double, double, int);
176/* secpar2d.c */
177int IL_secpar_loop_2d(struct interp_params *, int, int, int, struct BM *,
178 double *, double *, double *, double *, double *,
179 double *, int, int);
180/* segmen2d.c */
181double smallest_segment(struct multtree *, int);
182int IL_interp_segments_2d(struct interp_params *, struct tree_info *,
183 struct multtree *, struct BM *, double, double,
184 double *, double *, double *, double *, double *,
185 double *, double *, double *, double *, int, off_t,
186 double);
187/* segmen2d_parallel.c */
189 struct multtree *, struct BM *, double, double,
190 double *, double *, double *, double *, double *,
191 double *, double *, double *, double *, int, off_t,
192 double, int);
193/* vinput2d.c */
194int IL_vector_input_data_2d(struct interp_params *, struct Map_info *, int,
195 char *, char *, struct tree_info *, double *,
196 double *, double *, double *, double *, double *,
197 int *, double *);
198int process_point(double, double, double, double, struct tree_info *, double,
199 double *, double *, double *, double *, double *, double *,
200 int *, int *, int *);
201/* write2d.c */
202int IL_write_temp_2d(struct interp_params *, int, int, off_t);
struct Map_info Map2
double amin1(double, double)
Definition: minmax.c:67
int IL_grid_calc_2d(struct interp_params *, struct quaddata *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double)
Definition: interp2d.c:65
int IL_output_2d(struct interp_params *, struct Cell_head *, double, double, double, double, double, double, double, double, double, double, double, char *, double, int, int, int)
Definition: output2d.c:59
int IL_interp_segments_2d(struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, off_t, double)
Definition: segmen2d.c:47
struct BM * IL_create_bitmask(struct interp_params *)
Definition: input2d.c:40
int IL_resample_interp_segments_2d(struct interp_params *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double *, int, int, int, int, int, double, double, double, double, int)
Definition: ressegm2d.c:35
double IL_crst(double, double)
Definition: func2d.c:48
double interp_fn(double, double)
Definition: interpf.h:62
double IL_dist_square(double *, double *, int)
int IL_interp_segments_2d_parallel(struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, off_t, double, int)
struct field_info * ff
int interpder_fn(double, double, double *, double *)
Definition: interpf.h:64
int secpar_fn(struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)
Definition: interpf.h:57
int IL_input_data_2d(struct interp_params *, struct tree_info *, double *, double *, double *, double *, double *, double *, int *)
int wr_temp_fn(struct interp_params *, int, int, off_t)
Definition: interpf.h:66
int max1(int, int)
Definition: minmax.c:32
int IL_vector_input_data_2d(struct interp_params *, struct Map_info *, int, char *, char *, struct tree_info *, double *, double *, double *, double *, double *, double *, int *, double *)
Definition: vinput2d.c:51
void IL_init_func_2d(struct interp_params *, grid_calc_fn *, matrix_create_fn *, check_points_fn *, secpar_fn *, interp_fn *, interpder_fn *, wr_temp_fn *)
Definition: init2d.c:109
double amax1(double, double)
Definition: minmax.c:54
int min1(int, int)
Definition: minmax.c:18
int matrix_create_fn(struct interp_params *, struct triple *, int, double **, int *)
Definition: interpf.h:50
int translate_quad(struct multtree *, double, double, double, int)
Definition: input2d.c:92
int grid_calc_fn(struct interp_params *, struct quaddata *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double)
Definition: interpf.h:44
dbString sql2
int IL_write_temp_2d(struct interp_params *, int, int, off_t)
Definition: write2d.c:36
dbDriver * driver2
int IL_secpar_loop_2d(struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)
Definition: secpar2d.c:39
int IL_crstg(double, double, double *, double *)
Definition: func2d.c:106
int IL_check_at_points_2d(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple)
Definition: point2d.c:53
struct line_cats * Cats2
int process_point(double, double, double, double, struct tree_info *, double, double *, double *, double *, double *, double *, double *, int *, int *, int *)
Definition: vinput2d.c:306
void IL_init_params_2d(struct interp_params *, FILE *, int, int, double, int, int, char *, int, int, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, double, int, int, int, int, double, char *, char *, char *, char *, char *, char *, double, double, double, int, double, double, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, bool, struct TimeStamp *, int, const char *)
Definition: init2d.c:31
int count
int IL_matrix_create(struct interp_params *, struct triple *, int, double **, int *)
Definition: matrix.c:39
int check_points_fn(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple)
Definition: interpf.h:53
int IL_interp_segments_new_2d(struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, int, double)
int IL_matrix_create_alloc(struct interp_params *, struct triple *, int, double **, int *, double *)
Creates system of linear equations from interpolated points.
Definition: matrix.c:72
double smallest_segment(struct multtree *, int)
Definition: segmen2d.c:346
struct line_pnts * Pnts
int IL_resample_output_2d(struct interp_params *, double, double, double, double, double, double, double, double, double, double, double, char *, double *, struct Cell_head *, struct Cell_head *, char *, int)
Definition: resout2d.c:45
FCELL z
Definition: interpf.h:20
double x
Definition: interpf.h:18
double smooth
Definition: interpf.h:21
double y
Definition: interpf.h:19
check_points_fn * check_points
Definition: interpf.h:99
double zmult
Definition: interpf.h:70
FILE * Tmp_fd_xx
Definition: interpf.h:93
FILE * Tmp_fd_xy
Definition: interpf.h:94
DCELL * az
Definition: interpf.h:78
char * pcurv
Definition: interpf.h:85
interp_fn * interp
Definition: interpf.h:101
secpar_fn * secpar
Definition: interpf.h:100
FILE * fdinp
Definition: interpf.h:71
const char * wheresql
Definition: interpf.h:104
FILE * Tmp_fd_yy
Definition: interpf.h:94
grid_calc_fn * grid_calc
Definition: interpf.h:97
double fi
Definition: interpf.h:80
double x_orig
Definition: interpf.h:87
double theta
Definition: interpf.h:89
char * maskmap
Definition: interpf.h:76
DCELL * adxy
Definition: interpf.h:79
double rsm
Definition: interpf.h:83
FILE * Tmp_fd_dx
Definition: interpf.h:92
DCELL * adyy
Definition: interpf.h:79
DCELL * adx
Definition: interpf.h:78
double y_orig
Definition: interpf.h:87
FILE * Tmp_fd_z
Definition: interpf.h:92
DCELL * ady
Definition: interpf.h:78
double dmin
Definition: interpf.h:86
char * tcurv
Definition: interpf.h:85
double scalex
Definition: interpf.h:90
struct TimeStamp * ts
Definition: interpf.h:91
char * mcurv
Definition: interpf.h:85
FILE * Tmp_fd_dy
Definition: interpf.h:93
wr_temp_fn * wr_temp
Definition: interpf.h:103
char * aspect
Definition: interpf.h:84
char * elev
Definition: interpf.h:84
char * slope
Definition: interpf.h:84
interpder_fn * interpder
Definition: interpf.h:102
DCELL * adxx
Definition: interpf.h:79
bool create_devi
Definition: interpf.h:95
matrix_create_fn * matrix_create
Definition: interpf.h:98
Definition: qtree.h:57