23static int cmp_int(
const void *a,
const void *
b)
28 return (*
ai < *
bi ? -1 : (*
ai > *
bi));
91 int type, nlines, line, *
bline;
113 G_debug(1,
"nlines = %d", nlines);
115 for (line = 1; line <= nlines; line++) {
126 if (left != 0 || right != 0)
129 G_debug(2,
"line %d - bridge candidate", line);
138 G_debug(3,
"current line: %d", line);
160 G_debug(4,
" dangle -> no bridge");
164 if (
abs(next_line) == line) {
167 G_debug(5,
" other side reached");
180 G_debug(3,
" line %d is part of bridge chain", line);
void Vect_chtype_bridges(struct Map_info *Map, struct Map_info *Err, int *lines_changed, int *bridges_changed)
Change type of bridges in vector map.
void Vect_remove_bridges(struct Map_info *Map, struct Map_info *Err, int *lines_removed, int *bridges_removed)
Remove bridges from vector map.
void G_percent(long, long, int)
Print percent complete messages.
void void G_verbose_message(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int rbtree_insert(struct RB_TREE *, void *)
int rbtree_init_trav(struct RB_TRAV *, struct RB_TREE *)
void rbtree_clear(struct RB_TREE *)
struct RB_TREE * rbtree_create(rb_compare_fn *, size_t)
void * rbtree_find(struct RB_TREE *, const void *)
void * rbtree_traverse(struct RB_TRAV *)
void rbtree_destroy(struct RB_TREE *)
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)
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_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_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)
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes a new feature.
int Vect_get_line_areas(struct Map_info *, int, int *, int *)
Get area id on the left and right side of the boundary.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int dig_angle_next_line(struct Plus_head *, plus_t, int, int, float *)
Find line number of next angle to follow a line.
Basic topology-related info.
Feature geometry info - coordinates.