63 G_debug(3,
"nlines = %d", nlines);
65 for (i = 0; i < nlines; i++) {
82 G_debug(4,
" line1 = %d angle1 = %e line2 = %d angle2 = %e",
83 line1, angle1, line2, angle2);
85 if (angle2 == angle1) {
87 double length1, length2;
90 int new_short_line = 0;
91 int short_type, long_type,
type;
92 double x, y, z, nx, ny, nz;
94 G_debug(4,
" identical angles -> clean");
102 Points->
y[1], 0.0, 0);
110 Points->
y[np - 1], 0.0,
112 Points->
y[np - 2], 0.0, 0);
120 Points->
y[1], 0.0, 0);
128 Points->
y[np - 1], 0.0,
130 Points->
y[np - 2], 0.0, 0);
133 G_debug(4,
" length1 = %f length2 = %f", length1,
136 if (length1 < length2) {
149 if (short_line > 0) {
169 short_type, Points, SCats);
177 if (abs(line1) == abs(line2)) {
179 long_line = new_short_line;
181 long_line = -new_short_line;
189 for (j = 0; j < SCats->
n_cats; j++) {
192 for (j = 0; j < LCats->
n_cats; j++) {
plus_t Vect_get_num_nodes(const struct Map_info *)
Get number of nodes in vector map.
struct P_line ** Line
Array of vector geometries.
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)
int n_points
Number of points.
int Vect_clean_small_angles_at_nodes(struct Map_info *Map, int otype, struct Map_info *Err)
Clean small angles at nodes.
int Vect_line_prune(struct line_pnts *)
Remove duplicate points, i.e. zero length segments.
double Vect_points_distance(double, double, double, double, double, double, int)
Calculate distance of 2 points.
int Vect_get_node_n_lines(const struct Map_info *, int)
Get number of lines for node.
int Vect_get_node_coor(const struct Map_info *, int, double *, double *, double *)
Get node coordinates.
double * x
Array of X coordinates.
Feature geometry info - coordinates.
int Vect_get_node_line(const struct Map_info *, int, int)
Get line id for node line index.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int n_cats
Number of categories attached to element.
int * cat
Array of categories.
off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes a new feature.
float Vect_get_node_line_angle(const struct Map_info *, int, int)
Angle of segment of the line connected to the node.
int Vect_append_point(struct line_pnts *, double, double, double)
Appends one point to the end of a line.
struct Plus_head plus
Plus info (topology, version, ...)
int Vect_reset_cats(struct line_cats *)
Reset category structure to make sure cats structure is clean to be re-used.
void G_percent(long, long, int)
Print percent complete messages.
double * y
Array of Y coordinates.
int Vect_delete_line(struct Map_info *, off_t)
Delete existing feature (topological level required)
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
double * z
Array of Z coordinates.
int Vect_node_alive(const struct Map_info *, int)
Check if node is alive or dead (topological level required)
int * field
Array of layers (fields)
void void G_verbose_message(const char *,...) __attribute__((format(printf
int Vect_read_line(const struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
int G_debug(int, const char *,...) __attribute__((format(printf
void Vect_reset_line(struct line_pnts *)
Reset line.
int Vect_line_delete_point(struct line_pnts *, int)
Delete point at given index and move all points above down.
int Vect_cat_set(struct line_cats *, int, int)
Add new field/cat to category structure if doesn't exist yet.