37#include <grass/interpf.h>
57 double *xmin,
double *xmax,
double *ymin,
double *ymax,
double *zmin,
58 double *zmax,
int *n_points,
65 double ns_res, ew_res;
69 double xprev,
yprev,
zprev, x1, y1, z1,
d1, xt, yt, z, sm;
82 G_debug(2,
"IL_vector_input_data_2d(): field = %d, zcol = %s, scol = %s",
100 G_debug(3,
" driver = %s database = %s table = %s",
Fi->driver,
101 Fi->database,
Fi->table);
108 Fi->database,
Fi->driver);
140 G_message(
_(
"Reading features from vector map ..."));
172 G_warning(
_(
"Database record for cat %d not found"),
191 G_debug(5,
" z = %f sm = %f", z, sm);
196 for (i = 0; i < Points->
n_points; i++) {
200 params->
zmult, xmin, xmax, ymin, ymax, zmin, zmax,
208 for (i = 1; i < Points->
n_points; i++) {
216 d1 = (xt * xt + yt * yt);
226 xmax, ymin, ymax, zmin, zmax, &
npoint,
246 if ((
c1 > 5 * ew_res) || (
c2 > 5 * ew_res) || (
c3 > 5 * ns_res) ||
252 G_warning(
_(
"Strip exists with insufficient data"));
265 G_warning(
_(
"There are points outside specified 2D/3D region - %d "
273 G_warning(
_(
"%d points given for interpolation (after thinning) is "
274 "less than given NPMIN=%d"),
279 G_warning(
_(
"Zero points in the given region"));
285 _(
"Segmentation parameters set to invalid values: npmin= %d, "
287 "for smooth connection of segments, npmin > segmax (see manual)"),
292 G_warning(
_(
"There are less than %d points for interpolation. No "
293 "segmentation is necessary, to run the program faster set "
294 "segmax=%d (see manual)"),
309 double *xmin,
double *xmax,
double *ymin,
double *ymax,
316 static int first_time = 1;
327 if (!((
c1 >= 0) && (
c2 >= 0) && (
c3 >= 0) && (
c4 >= 0))) {
329 G_warning(
_(
"Some points outside of region (ignored)"));
343 G_warning(
_(
"Unable to insert %f,%f,%f a = %d"),
x, y, z, a);
357 *ymin =
amin1(*ymin, y);
358 *zmin =
amin1(*zmin, z);
361 *zmax =
amax1(*zmax, z);
struct triple * quad_point_new(double x, double y, double z, double sm)
Main header of GRASS DataBase Management Interface.
void db_CatValArray_free(dbCatValArray *)
Free allocated dbCatValArray.
int db_CatValArray_get_value_int(dbCatValArray *, int, int *)
Find value (integer) by key.
void db_CatValArray_init(dbCatValArray *)
Initialize dbCatValArray.
int db_column_Ctype(dbDriver *, const char *, const char *)
Get column ctype.
int db_open_database(dbDriver *, dbHandle *)
Open database connection.
int db_close_database_shutdown_driver(dbDriver *)
Close driver/database connection.
int db_select_CatValArray(dbDriver *, const char *, const char *, const char *, const char *, dbCatValArray *)
Select pairs key/value to array, values are sorted by key (must be integer)
int db_set_handle(dbHandle *, const char *, const char *)
Set handle (database and schema name)
dbDriver * db_start_driver(const char *)
Initialize a new dbDriver for db transaction.
void db_init_handle(dbHandle *)
Initialize handle (i.e database/schema)
void db_init_string(dbString *)
Initialize dbString.
int db_CatValArray_get_value_double(dbCatValArray *, int, double *)
Find value (double) by key.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
void void G_verbose_message(const char *,...) __attribute__((format(printf
void void void G_important_message(const char *,...) __attribute__((format(printf
void G_message(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_cat_get(const struct line_cats *, int, int *)
Get first found category of given field.
struct field_info * Vect_get_field(struct Map_info *, int)
Get information about link to database (by layer number)
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
const char * Vect_get_full_name(struct Map_info *)
Get fully qualified name of vector map.
int Vect_read_next_line(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_is_3d(struct Map_info *)
Check if vector map is 3D.
#define GV_POINT
Feature types used in memory on run time (may change)
double amin1(double, double)
double amax1(double, double)
int MT_insert(struct triple *point, struct tree_info *info, struct multtree *tree, int n_leafs)
Layer (old: field) information.
char * driver
Name of DB driver ('sqlite', 'dbf', ...)
int * cat
Array of categories.
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
double * x
Array of X coordinates.
int n_points
Number of points.
double * z
Array of Z coordinates.