35 int i, line, nlines, ntypes, mtype;
40 G_debug(3,
"Vect_select_lines_by_box()");
41 G_debug(3,
" Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e",
Box->N,
Box->S,
91 G_debug(3,
" %d lines selected (all types)", nlines);
94 for (i = 0; i < nlines; i++) {
95 line = LocList->
id[i];
98 Line = plus->
Line[line];
99 if (!(Line->
type & type))
104 G_debug(3,
" %d lines of requested type",
list->n_values);
106 return list->n_values;
125 static int debug_level = -1;
127 if (debug_level == -1) {
131 debug_level = atoi(dstr);
136 G_debug(3,
"Vect_select_areas_by_box()");
137 G_debug(3,
"Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e",
Box->N,
Box->S,
143 if (debug_level > 2) {
144 for (i = 0; i <
list->n_values; i++) {
145 G_debug(3,
" area = %d pointer to area structure = %p",
150 return list->n_values;
168 G_debug(3,
"Vect_select_isles_by_box()");
169 G_debug(3,
"Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e",
Box->N,
Box->S,
175 return list->n_values;
192 G_debug(3,
"Vect_select_nodes_by_box()");
193 G_debug(3,
"Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e",
Box->N,
Box->S,
203 return list->n_values;
231 G_debug(3,
"Vect_select_lines_by_polygon() nisles = %d", nisles);
248 for (i = 0; i < LocList->
n_values; i++) {
249 int j, line, intersect = 0;
251 line = LocList->
id[i];
256 for (j = 0; j < LPoints->
n_points; j++) {
261 for (k = 0; k < nisles; k++) {
288 for (j = 0; j < nisles; j++) {
325 G_debug(3,
"Vect_select_areas_by_polygon() nisles = %d", nisles);
336 for (i = 0; i < BoundList->
n_values; i++) {
337 int line, left, right;
339 line = BoundList->
value[i];
342 G_debug(4,
"boundary = %d left = %d right = %d", line, left, right);
349 G_debug(4,
" left island -> area = %d", area);
357 else if (right < 0) {
359 G_debug(4,
" right island -> area = %d", area);
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_getenv_nofatal(const char *)
Get environment variable.
int Vect_reset_boxlist(struct boxlist *)
Reset boxlist structure.
struct boxlist * Vect_new_boxlist(int)
Creates and initializes a struct boxlist.
int Vect_list_append(struct ilist *, int)
Append new item to the end of list if not yet present.
int Vect_read_line(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
int Vect_line_check_intersection(struct line_pnts *, struct line_pnts *, int)
Check if 2 lines intersect.
struct ilist * Vect_new_list(void)
Creates and initializes a struct ilist.
int Vect_point_in_poly(double, double, const struct line_pnts *)
Determines if a point (X,Y) is inside a polygon.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_get_line_areas(struct Map_info *, int, int *, int *)
Get area id on the left and right side of the boundary.
int Vect_reset_list(struct ilist *)
Reset ilist structure.
int Vect_find_area(struct Map_info *, double, double)
Find the nearest area.
int Vect_get_isle_area(struct Map_info *, int)
Returns area id for isle.
#define GV_POINT
Feature types used in memory on run time (may change)
#define PORT_DOUBLE_MAX
Limits for portable types.
int dig_init_boxlist(struct boxlist *, int)
int dig_select_isles(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select isles with boxes by box.
int dig_select_lines(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select lines with boxes by box.
int dig_select_areas(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select areas with boxes by box.
int dig_boxlist_add(struct boxlist *, int, const struct bound_box *)
int dig_select_nodes(struct Plus_head *, const struct bound_box *, struct ilist *)
Select nodes by bbox.
int dig_line_box(const struct line_pnts *, struct bound_box *)
float Box[8][3]
Vertices for 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_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_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_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.
int Vect_select_nodes_by_box(struct Map_info *Map, const struct bound_box *Box, struct ilist *list)
Select nodes by box.
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.
struct Plus_head plus
Plus info (topology, version, ...)
Basic topology-related info.
plus_t n_klines
Current number of kernels.
struct P_line ** Line
Array of vector geometries.
plus_t n_plines
Current number of points.
plus_t n_blines
Current number of boundaries.
struct P_area ** Area
Array of areas.
plus_t n_clines
Current number of centroids.
plus_t n_flines
Current number of faces.
plus_t n_llines
Current number of lines.
List of bounding boxes with id.
struct bound_box * box
Array of bounding boxes.
int n_values
Number of items in the list.
int n_values
Number of values in the list.
int * value
Array of values.
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
double * x
Array of X coordinates.
int n_points
Number of points.