111static int cmp(
const void *a,
const void *
b)
121static void sort_ilist(
struct ilist *
List)
125 for (i = 1; i <
List->n_values; i++) {
126 if (
List->value[i - 1] >
List->value[i]) {
135 if (
List->n_values > 1) {
137 for (i = 1; i <
List->n_values; i++) {
138 if (
List->value[
j - 1] !=
List->value[i]) {
154 int i,
j, k,
l,
ret,
atype,
btype,
aline,
bline,
found,
iline;
201 G_debug(3,
"nlines = %d", nlines);
296 G_debug(3,
" %d lines selected by box",
List->n_values);
298 for (
j = -1;
j <
List->n_values;
j++) {
383 "lines %d and %d touching by end nodes only -> "
413 G_debug(3,
" Check collapsed loop");
425 for (i = 0; i <=
centre; i++)
447 G_debug(3,
" aline = %d, bline = %d, naxlines = %d",
aline,
460 G_debug(3,
"Line %d written, npoints = %d",
ret,
471 G_debug(3,
"axline %d has zero length", k);
493 G_debug(3,
" aline = %d, bline = %d, nbxlines = %d",
516 G_debug(3,
"bxline %d has zero length", k);
522 for (
l = 0;
l < nx;
l++) {
547 for (
l = 0;
l < nx;
l++) {
558 G_debug(3,
"aline was broken, use next one");
573 G_debug(3,
"nlines = %d", nlines);
void Vect_break_lines(struct Map_info *Map, int type, struct Map_info *Err)
Break lines in vector map at each intersection.
int Vect_break_lines_list(struct Map_info *Map, struct ilist *List_break, struct ilist *List_ref, int type, struct Map_info *Err)
Break selected lines in vector map at each intersection.
int Vect_check_line_breaks(struct Map_info *Map, int type, struct Map_info *Err)
Check for and count intersecting lines, do not break.
int Vect_check_line_breaks_list(struct Map_info *Map, struct ilist *List_break, struct ilist *List_ref, int type, struct Map_info *Err)
Check for and count intersecting lines, do not break.
void G_percent(long, long, int)
Print percent complete messages.
void G_free(void *)
Free allocated memory.
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.
int Vect_get_node_coor(struct Map_info *, int, double *, double *, double *)
Get node coordinates.
plus_t Vect_get_num_lines(struct Map_info *)
Fetch number of features (points, lines, boundaries, centroids) in vector map.
void Vect_line_box(const struct line_pnts *, struct bound_box *)
Get bounding box of line.
struct boxlist * Vect_new_boxlist(int)
Creates and initializes a struct boxlist.
int Vect_line_intersection2(struct line_pnts *, struct line_pnts *, struct bound_box *, struct bound_box *, struct line_pnts ***, struct line_pnts ***, int *, int *, int)
Intersect 2 lines.
void Vect_destroy_boxlist(struct boxlist *)
Frees all memory associated with a struct boxlist, 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)
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_select_lines_by_box(struct Map_info *, const struct bound_box *, int, struct boxlist *)
Select lines with bounding boxes by box.
void Vect_reset_line(struct line_pnts *)
Reset line.
int Vect_line_prune(struct line_pnts *)
Remove duplicate points, i.e. zero length segments.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_is_3d(struct Map_info *)
Check if vector map is 3D.
int Vect_append_point(struct line_pnts *, double, double, double)
Appends one point to the end of a line.
#define GV_POINT
Feature types used in memory on run time (may change)
List of bounding boxes with id.
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
double * x
Array of X coordinates.
int n_points
Number of points.
double * z
Array of Z coordinates.