37 int i, line, nlines, ntypes, mtype;
42 G_debug(3,
"Vect_select_lines_by_box()");
43 G_debug(3,
" Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e", Box->
N, Box->
S,
44 Box->
E, Box->
W, Box->
T, Box->
B);
93 G_debug(3,
" %d lines selected (all types)", nlines);
96 for (i = 0; i < nlines; i++) {
97 line = LocList->
id[i];
100 Line = plus->
Line[line];
101 if (!(Line->
type & type))
129 static int debug_level = -1;
131 if (debug_level == -1) {
135 debug_level = atoi(dstr);
140 G_debug(3,
"Vect_select_areas_by_box()");
141 G_debug(3,
"Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e", Box->
N, Box->
S,
142 Box->
E, Box->
W, Box->
T, Box->
B);
147 if (debug_level > 2) {
148 for (i = 0; i < list->
n_values; i++) {
149 G_debug(3,
" area = %d pointer to area structure = %p",
174 G_debug(3,
"Vect_select_isles_by_box()");
175 G_debug(3,
"Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e", Box->
N, Box->
S,
176 Box->
E, Box->
W, Box->
T, Box->
B);
199 G_debug(3,
"Vect_select_nodes_by_box()");
200 G_debug(3,
"Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e", Box->
N, Box->
S,
201 Box->
E, Box->
W, Box->
T, Box->
B);
229 int nisles,
struct line_pnts **Isles,
int type,
238 G_debug(3,
"Vect_select_lines_by_polygon() nisles = %d", nisles);
255 for (i = 0; i < LocList->
n_values; i++) {
256 int j, line, intersect = 0;
258 line = LocList->
id[i];
263 for (j = 0; j < LPoints->
n_points; j++) {
267 for (k = 0; k < nisles; k++) {
293 for (j = 0; j < nisles; j++) {
332 G_debug(3,
"Vect_select_areas_by_polygon() nisles = %d", nisles);
343 for (i = 0; i < BoundList->
n_values; i++) {
344 int line, left, right;
346 line = BoundList->
value[i];
349 G_debug(4,
"boundary = %d left = %d right = %d", line, left, right);
356 G_debug(4,
" left island -> area = %d", area);
364 else if (right < 0) {
366 G_debug(4,
" right island -> area = %d", area);
int Vect_select_lines_by_polygon(struct Map_info *Map, struct line_pnts *Polygon, int nisles, struct line_pnts **Isles, int type, struct ilist *List)
Select lines by Polygon with optional isles.
int Vect_select_areas_by_box(struct Map_info *Map, const struct bound_box *Box, struct boxlist *list)
Select areas with bounding boxes by box.
int Vect_select_lines_by_box(struct Map_info *Map, const struct bound_box *Box, int type, struct boxlist *list)
Select lines with bounding boxes by box.
int Vect_point_in_poly(double, double, const struct line_pnts *)
Determines if a point (X,Y) is inside a polygon.
int Vect_select_areas_by_polygon(struct Map_info *Map, struct line_pnts *Polygon, int nisles, struct line_pnts **Isles, struct ilist *List)
Select areas by Polygon with optional isles.
plus_t n_klines
Current number of kernels.
int Vect_reset_list(struct ilist *)
Reset ilist structure.
struct P_line ** Line
Array of vector geometries.
int Vect_select_nodes_by_box(struct Map_info *Map, const struct bound_box *Box, struct ilist *list)
Select nodes by box.
float Box[8][3]
Vertices for box.
plus_t n_plines
Current number of points.
int dig_select_isles(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select isles with boxes by box.
struct P_area ** Area
Array of areas.
int dig_line_box(const struct line_pnts *, struct bound_box *)
int n_points
Number of points.
int n_values
Number of values in the list.
int n_values
Number of items in the list.
#define GV_POINT
Feature types used in memory on run time (may change)
struct bound_box * box
Array of bounding boxes.
int dig_boxlist_add(struct boxlist *, int, const struct bound_box *)
double * x
Array of X coordinates.
Feature geometry info - coordinates.
Basic topology-related info.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int dig_select_nodes(struct Plus_head *, const struct bound_box *, struct ilist *)
Select nodes by bbox.
struct Plus_head plus
Plus info (topology, version, ...)
int Vect_select_isles_by_box(struct Map_info *Map, const struct bound_box *Box, struct boxlist *list)
Select isles with bounding boxes by box.
int dig_init_boxlist(struct boxlist *, int)
plus_t n_flines
Current number of faces.
int Vect_get_isle_area(const struct Map_info *, int)
Returns area id for isle.
int Vect_reset_boxlist(struct boxlist *)
Reset boxlist structure.
int Vect_find_area(struct Map_info *, double, double)
Find the nearest area.
#define PORT_DOUBLE_MAX
Limits for portable types.
double * y
Array of Y coordinates.
plus_t n_llines
Current number of lines.
struct ilist * Vect_new_list(void)
Creates and initializes a struct ilist.
int dig_select_areas(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select areas with boxes by box.
int Vect_list_append(struct ilist *, int)
Append new item to the end of list if not yet present.
List of bounding boxes with id.
plus_t n_clines
Current number of centroids.
const char * G_getenv_nofatal(const char *)
Get environment variable.
int * value
Array of values.
struct boxlist * Vect_new_boxlist(int)
Creates and initializes a struct boxlist.
plus_t n_blines
Current number of boundaries.
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
int Vect_get_line_areas(const struct Map_info *, int, int *, int *)
Get area id on the left and right side of the boundary.
int Vect_line_check_intersection(struct line_pnts *, struct line_pnts *, int)
Check if 2 lines intersect.
int dig_select_lines(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select lines with boxes by box.