43 double east, north, dist;
56 for (i = 0; i <
List->n_values; i++) {
57 line =
List->value[i];
82 for (
j = 0;
j <
coord->n_points;
j++) {
87 for (k = 0; k < Points->
n_points; k++) {
93 "Vedit_move_vertex(): line=%d; x=%f, y=%f -> "
103 G_debug(3,
"Vedit_move_vertex(): line=%d, point=%d",
139 y[npoints - 1], z[npoints - 1],
143 x[0] =
x[npoints - 1];
144 y[0] = y[npoints - 1];
146 z[0] = z[npoints - 1];
148 else if (
moved[npoints - 1] == 1) {
149 x[npoints - 1] =
x[0];
150 y[npoints - 1] = y[0];
152 z[npoints - 1] = z[0];
195 double east, north, dist;
206 for (i = 0; i <
List->n_values; i++) {
207 line =
List->value[i];
217 G_debug(3,
"Vedit_add_vertex(): line = %d, thresh = %f", line,
thresh);
223 for (
j = 0;
j <
coord->n_points;
j++) {
240 G_debug(3,
"Vedit_add_vertex(): line=%d; x=%f, y=%f, index=%d",
294 for (i = 0; i <
List->n_values; i++) {
295 line =
List->value[i];
309 for (
j = 0;
j <
coord->n_points;
j++) {
313 for (k = 0; k < Points->
n_points; k++) {
321 "Vedit_remove_vertex(): line=%d; x=%f, y=%f, index=%d",
322 line,
x[k], y[k], k);
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_free(void *)
Free allocated memory.
int G_debug(int, const char *,...) __attribute__((format(printf
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
off_t Vect_rewrite_line(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites existing feature (topological level required)
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
int Vect_read_line(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
int Vect_line_distance(const struct line_pnts *, double, double, double, int, double *, double *, double *, double *, double *, double *)
Calculate distance of point to line.
double Vect_points_distance(double, double, double, double, double, double, int)
Calculate distance of 2 points.
int Vect_line_alive(struct Map_info *, int)
Check if feature is alive or dead (topological level required)
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
int Vect_line_insert_point(struct line_pnts *, int, double, double, double)
Insert new point at index position and move all old points at that position and above up.
int Vect_line_delete_point(struct line_pnts *, int)
Delete point at given index and move all points above down.
int Vect_line_prune(struct line_pnts *)
Remove duplicate points, i.e. zero length segments.
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.
int Vedit_snap_point(struct Map_info *, int, double *, double *, double *, double, int)
Snap given point to the nearest primitive.
#define WITHOUT_Z
2D/3D vector data
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.
int Vedit_move_vertex(struct Map_info *Map, struct Map_info **BgMap, int nbgmaps, struct ilist *List, struct line_pnts *coord, double thresh_coords, double thresh_snap, double move_x, double move_y, double move_z, int move_first, int snap)
Move all vertices in bounding box(es)
int Vedit_add_vertex(struct Map_info *Map, struct ilist *List, struct line_pnts *coord, double thresh)
Add new vertex to line.
int Vedit_remove_vertex(struct Map_info *Map, struct ilist *List, struct line_pnts *coord, double thresh)
Remove vertex from line.