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>
40 double dnorm,
struct triple skip_point)
50 double east = data->
xmax;
51 double west = data->
x_orig;
52 double north = data->
ymax;
53 double south = data->
y_orig;
54 double rfsta2, errmax,
h, xx, yy, r2, hz, zz,
err, xmm, ymm,
r;
67 fstar2 = params->
fi * params->
fi / 4.;
70 for (mm = 1; mm <= n_points; mm++) {
72 for (m = 1; m <= n_points; m++) {
73 xx = points[mm - 1].
x - points[m - 1].
x;
74 yy = points[mm - 1].
y - points[m - 1].
y;
75 r2 = yy * yy + xx * xx;
79 h = h + b[m] * params->
interp(r, params->
fi);
88 zz = points[mm - 1].
z + zmin;
90 xmm = points[mm - 1].
x * dnorm + params->
x_orig + west;
91 ymm = points[mm - 1].
y * dnorm + params->
y_orig + south;
92 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig)
93 && (ymm >= south + params->
y_orig) &&
94 (ymm <= north + params->y_orig))
111 sprintf(buf,
"insert into %s values ( %d ",
ff->table, cat);
129 (*ertot) += err *
err;
135 for (m = 1; m <= n_points - 1; m++) {
136 xx = points[m - 1].
x - skip_point.
x;
137 yy = points[m - 1].
y - skip_point.
y;
138 r2 = yy * yy + xx * xx;
140 rfsta2 = fstar2 * r2;
142 h = h + b[m] * params->
interp(r, params->
fi);
146 zz = skip_point.
z + zmin;
148 xmm = skip_point.
x * dnorm + params->
x_orig + west;
149 ymm = skip_point.
y * dnorm + params->
y_orig + south;
151 if ((xmm >= west + params->
x_orig) && (xmm <= east + params->x_orig)
152 && (ymm >= south + params->
y_orig) &&
153 (ymm <= north + params->y_orig))
168 sprintf(buf,
"insert into %s values ( %d ",
ff->table, cat);
171 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...