28 #include <grass/gis.h>
29 #include <grass/site.h>
30 #include <grass/Vect.h>
31 #include <grass/dbmi.h>
34 #include <grass/interpf.h>
45 double dnorm,
struct triple skip_point)
55 double east = data->
xmax;
56 double west = data->
x_orig;
57 double north = data->
ymax;
58 double south = data->
y_orig;
59 double rfsta2, errmax,
h, xx, yy, r2, hz, zz,
err, xmm, ymm,
r;
72 fstar2 = params->
fi * params->
fi / 4.;
75 for (mm = 1; mm <= n_points; mm++) {
77 for (m = 1; m <= n_points; m++) {
78 xx = points[mm - 1].
x - points[m - 1].
x;
79 yy = points[mm - 1].
y - points[m - 1].
y;
80 r2 = yy * yy + xx * xx;
84 h = h + b[m] * params->
interp(r, params->
fi);
93 zz = points[mm - 1].
z + zmin;
95 xmm = points[mm - 1].
x * dnorm + params->
x_orig + west;
96 ymm = points[mm - 1].
y * dnorm + params->
y_orig + south;
97 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig)
98 && (ymm >= south + params->
y_orig) &&
99 (ymm <= north + params->y_orig))
116 sprintf(buf,
"insert into %s values ( %d ",
ff->table, cat);
134 (*ertot) += err *
err;
140 for (m = 1; m <= n_points - 1; m++) {
141 xx = points[m - 1].
x - skip_point.
x;
142 yy = points[m - 1].
y - skip_point.
y;
143 r2 = yy * yy + xx * xx;
145 rfsta2 = fstar2 * r2;
147 h = h + b[m] * params->
interp(r, params->
fi);
151 zz = skip_point.
z + zmin;
153 xmm = skip_point.
x * dnorm + params->
x_orig + west;
154 ymm = skip_point.
y * dnorm + params->
y_orig + south;
156 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig)
157 && (ymm >= south + params->
y_orig) &&
158 (ymm <= north + params->y_orig))
173 sprintf(buf,
"insert into %s values ( %d ",
ff->table, cat);
176 sprintf(buf,
", %f", skip_err);
void db_zero_string(dbString *x)
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int db_shutdown_driver(dbDriver *driver)
Closedown the driver, and free the driver structure.
int db_close_database(dbDriver *driver)
Close database connection.
int Vect_reset_line(struct line_pnts *Points)
Reset line.
int Vect_reset_cats(struct line_cats *Cats)
Reset category structure to make sure cats structure is clean to be re-used.
int IL_check_at_points_2d(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple)
int db_execute_immediate(dbDriver *driver, dbString *SQLstatement)
Execute SQL statements.
int Vect_append_point(struct line_pnts *Points, double x, double y, double z)
Appends one point to the end of a line.
int db_append_string(dbString *x, const char *s)
int Vect_cat_set(struct line_cats *Cats, int field, int cat)
Add new field/cat to category structure if doesn't exist yet.
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
char * db_get_string(dbString *x)
int G_debug(int level, const char *msg,...)
Print debugging message.
long Vect_write_line(struct Map_info *Map, int type, struct line_pnts *points, struct line_cats *cats)
Writes new feature to the end of file (table)
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
tuple h
panel.defaultSize = wx.CheckBox(panel, id = wx.ID_ANY, label = _("Use default size")) panel...