34 #include <grass/interpf.h>
57 double dnorm,
struct triple skip_point)
61 double east = data->
xmax;
62 double west = data->
x_orig;
63 double north = data->
ymax;
64 double south = data->
y_orig;
65 double h, xx, yy, r2, hz, zz,
err, xmm, ymm,
r;
81 for (mm = 1; mm <= n_points; mm++) {
83 for (m = 1; m <= n_points; m++) {
84 xx = points[mm - 1].
x - points[m - 1].
x;
85 yy = points[mm - 1].
y - points[m - 1].
y;
86 r2 = yy * yy + xx * xx;
99 zz = points[mm - 1].
z + zmin;
101 xmm = points[mm - 1].
x * dnorm + params->
x_orig + west;
102 ymm = points[mm - 1].
y * dnorm + params->
y_orig + south;
103 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig) &&
104 (ymm >= south + params->
y_orig) && (ymm <= north + params->y_orig))
121 sprintf(buf,
"insert into %s values ( %d ",
ff->
table, cat);
124 sprintf(buf,
", %f",
err);
144 for (m = 1; m <= n_points - 1; m++) {
145 xx = points[m - 1].
x - skip_point.
x;
146 yy = points[m - 1].
y - skip_point.
y;
147 r2 = yy * yy + xx * xx;
155 zz = skip_point.
z + zmin;
157 xmm = skip_point.
x * dnorm + params->
x_orig + west;
158 ymm = skip_point.
y * dnorm + params->
y_orig + south;
160 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig) &&
161 (ymm >= south + params->
y_orig) && (ymm <= north + params->y_orig))
176 sprintf(buf,
"insert into %s values ( %d ",
ff->
table, cat);
179 sprintf(buf,
", %f", skip_err);
int db_shutdown_driver(dbDriver *)
Closedown the driver, and free the driver structure.
void db_zero_string(dbString *)
Zero string.
int db_execute_immediate(dbDriver *, dbString *)
Execute SQL statements.
int db_close_database(dbDriver *)
Close database connection.
int db_append_string(dbString *, const char *)
Append string to dbString.
char * db_get_string(const dbString *)
Get string.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_reset_cats(struct line_cats *)
Reset category structure to make sure cats structure is clean to be re-used.
int Vect_cat_set(struct line_cats *, int, int)
Add new field/cat to category structure if doesn't exist yet.
off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes a new feature.
void Vect_reset_line(struct line_pnts *)
Reset line.
int Vect_append_point(struct line_pnts *, double, double, double)
Appends one point to the end of a line.
#define GV_POINT
Feature types used in memory on run time (may change)
int IL_check_at_points_2d(struct interp_params *params, struct quaddata *data, double *b, double *ertot, double zmin, double dnorm, struct triple skip_point)
char * table
Name of DB table.
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)