34 #include <grass/interpf.h>
57 double dnorm,
struct triple *skip_point)
61 struct triple point_writeout;
62 double east = data->
xmax;
63 double west = data->
x_orig;
64 double north = data->
ymax;
65 double south = data->
y_orig;
66 double h, xx, yy, r2, hz, zz,
err, xmm, ymm,
r;
79 for (mm = 1; mm <= n_points; mm++) {
81 for (m = 1; m <= n_points; m++) {
82 xx = points[mm - 1].
x - points[m - 1].
x;
83 yy = points[mm - 1].
y - points[m - 1].
y;
84 r2 = yy * yy + xx * xx;
97 zz = points[mm - 1].
z + zmin;
99 xmm = points[mm - 1].
x * dnorm + params->
x_orig + west;
100 ymm = points[mm - 1].
y * dnorm + params->
y_orig + south;
101 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig) &&
102 (ymm >= south + params->
y_orig) && (ymm <= north + params->y_orig))
110 point_writeout.
x = xmm;
111 point_writeout.
y = ymm;
112 point_writeout.
z = zz;
122 for (m = 1; m <= n_points - 1; m++) {
123 xx = points[m - 1].
x - skip_point->
x;
124 yy = points[m - 1].
y - skip_point->
y;
125 r2 = yy * yy + xx * xx;
133 zz = skip_point->
z + zmin;
135 xmm = skip_point->
x * dnorm + params->
x_orig + west;
136 ymm = skip_point->
y * dnorm + params->
y_orig + south;
138 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig) &&
139 (ymm >= south + params->
y_orig) && (ymm <= north + params->y_orig))
145 point_writeout.
x = xmm;
146 point_writeout.
y = ymm;
147 point_writeout.
z = zz;
177 sprintf(buf,
"insert into %s values ( %d ",
ff->
table,
count);
180 sprintf(buf,
", %f",
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)
int IL_write_point_2d(struct triple point, double err)
A function to write out point and deviation at point to database.
char * table
Name of DB table.
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)