42 for (i = 0; i < ACats->
n_cats; i++) {
45 for (j = 0; j < BCats->
n_cats; j++) {
46 if (ACats->
cat[i] == BCats->
cat[j] &&
81 int line, nlines, i, first, last, next_line, curr_line;
82 int merged = 0, newl = 0;
83 int next_node, direction, node_n_lines, ltype, lines_type;
94 (
"Merging is done with lines or boundaries only, not with other types");
107 for (line = 1; line <= nlines; line++) {
113 Line = Plus->
Line[line];
137 for (i = 0; i < node_n_lines; i++) {
139 if ((Plus->
Line[abs(curr_line)]->type & GV_LINES))
141 if (Plus->
Line[abs(curr_line)]->type == ltype) {
142 if (abs(curr_line) != abs(first)) {
146 if (compare_cats(MCats, Cats) == 0)
147 next_line = curr_line;
151 if (lines_type == 2 && abs(next_line) != abs(first) &&
152 abs(next_line) != line) {
185 for (i = 0; i < node_n_lines; i++) {
187 if ((Plus->
Line[abs(curr_line)]->type & GV_LINES))
189 if (Plus->
Line[abs(curr_line)]->type == ltype) {
190 if (abs(curr_line) != abs(last)) {
193 if (compare_cats(MCats, Cats) == 0)
194 next_line = curr_line;
199 if (lines_type == 2 && abs(next_line) != abs(last) &&
200 abs(next_line) != abs(first)) {
219 for (i = 0; i < List->
n_values; i++) {
int Vect_append_points(struct line_pnts *, const struct line_pnts *, int)
Appends points to the end of a line.
#define GV_FORWARD
Line direction indicator forward/backward.
int Vect_reset_list(struct ilist *)
Reset ilist structure.
struct P_line ** Line
Array of vector geometries.
int Vect_merge_lines(struct Map_info *Map, int type, int *new_lines, struct Map_info *Err)
Merge lines or boundaries in vector map.
plus_t Vect_get_num_lines(const struct Map_info *)
Fetch number of features (points, lines, boundaries, centroids) in vector map.
int n_points
Number of points.
int n_values
Number of values in the list.
int Vect_get_node_n_lines(const struct Map_info *, int)
Get number of lines for node.
void G_ilist_add(struct ilist *, int)
Add item to ilist.
Feature geometry info - coordinates.
int Vect_get_node_line(const struct Map_info *, int, int)
Get line id for node line index.
Basic topology-related info.
void Vect_destroy_list(struct ilist *)
Frees all memory associated with a struct ilist, including the struct itself.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
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.
struct Plus_head plus
Plus info (topology, version, ...)
int Vect_get_line_nodes(const struct Map_info *, int, int *, int *)
Get line nodes.
void G_percent(long, long, int)
Print percent complete messages.
struct ilist * Vect_new_list(void)
Creates and initializes a struct ilist.
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.
void G_warning(const char *,...) __attribute__((format(printf
int Vect_line_alive(const struct Map_info *, int)
Check if feature is alive or dead (topological level required)
int * field
Array of layers (fields)
int * value
Array of values.
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
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.