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;
93 G_warning(
"Merging is done with lines or boundaries only, not with "
107 for (line = 1; line <= nlines; line++) {
113 Line = Plus->
Line[line];
139 for (i = 0; i < node_n_lines; i++) {
143 if (Plus->
Line[abs(curr_line)]->
type == ltype) {
144 if (abs(curr_line) != abs(first)) {
148 if (compare_cats(MCats, Cats) == 0)
149 next_line = curr_line;
153 if (lines_type == 2 && abs(next_line) != abs(first) &&
154 abs(next_line) != line) {
188 for (i = 0; i < node_n_lines; i++) {
192 if (Plus->
Line[abs(curr_line)]->
type == ltype) {
193 if (abs(curr_line) != abs(last)) {
196 if (compare_cats(MCats, Cats) == 0)
197 next_line = curr_line;
202 if (lines_type == 2 && abs(next_line) != abs(last) &&
203 abs(next_line) != abs(first)) {
222 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.