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] &&
82 int line, nlines, i, first, last, next_line, curr_line;
83 int merged = 0, newl = 0;
84 int next_node, direction, node_n_lines, ltype, lines_type;
94 G_warning(
"Merging is done with lines or boundaries only, not with "
108 for (line = 1; line <= nlines; line++) {
114 Line = Plus->
Line[line];
140 for (i = 0; i < node_n_lines; i++) {
144 if (Plus->
Line[abs(curr_line)]->
type == ltype) {
145 if (abs(curr_line) != abs(first)) {
149 if (compare_cats(MCats, Cats) == 0)
150 next_line = curr_line;
154 if (lines_type == 2 && abs(next_line) != abs(first) &&
155 abs(next_line) != line) {
189 for (i = 0; i < node_n_lines; i++) {
193 if (Plus->
Line[abs(curr_line)]->
type == ltype) {
194 if (abs(curr_line) != abs(last)) {
197 if (compare_cats(MCats, Cats) == 0)
198 next_line = curr_line;
203 if (lines_type == 2 && abs(next_line) != abs(last) &&
204 abs(next_line) != abs(first)) {
223 for (i = 0; i < List->
n_values; i++) {
void G_percent(long, long, int)
Print percent complete messages.
void G_warning(const char *,...) __attribute__((format(printf
void void G_verbose_message(const char *,...) __attribute__((format(printf
void G_ilist_add(struct ilist *, int)
Add item to ilist.
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.
int Vect_get_line_nodes(struct Map_info *, int, int *, int *)
Get line nodes.
plus_t Vect_get_num_lines(struct Map_info *)
Fetch number of features (points, lines, boundaries, centroids) in vector map.
void Vect_destroy_list(struct ilist *)
Frees all memory associated with a struct ilist, including the struct itself.
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)
struct ilist * Vect_new_list(void)
Creates and initializes a struct ilist.
int Vect_line_alive(struct Map_info *, int)
Check if feature is alive or dead (topological level required)
int Vect_delete_line(struct Map_info *, off_t)
Delete existing feature (topological level required)
off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes a new feature.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_get_node_n_lines(struct Map_info *, int)
Get number of lines for node.
void Vect_reset_line(struct line_pnts *)
Reset line.
int Vect_get_node_line(struct Map_info *, int, int)
Get line id for node line index.
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
int Vect_reset_list(struct ilist *)
Reset ilist structure.
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_merge_lines(struct Map_info *Map, int type, int *new_lines, struct Map_info *Err)
Merge lines or boundaries in vector map.
struct Plus_head plus
Plus info (topology, version, ...)
Basic topology-related info.
struct P_line ** Line
Array of vector geometries.
int n_values
Number of values in the list.
int * value
Array of values.
int * field
Array of layers (fields)
int * cat
Array of categories.
int n_cats
Number of categories attached to element.
Feature geometry info - coordinates.
int n_points
Number of points.