GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vector/Vlib/select.c File Reference
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/Vect.h>
Include dependency graph for vector/Vlib/select.c:

Go to the source code of this file.

Functions

int Vect_select_lines_by_box (struct Map_info *Map, BOUND_BOX *Box, int type, struct ilist *list)
 Select lines by box. More...
 
int Vect_select_areas_by_box (struct Map_info *Map, BOUND_BOX *Box, struct ilist *list)
 Select areas by box. More...
 
int Vect_select_isles_by_box (struct Map_info *Map, BOUND_BOX *Box, struct ilist *list)
 Select isles by box. More...
 
int Vect_select_nodes_by_box (struct Map_info *Map, BOUND_BOX *Box, struct ilist *list)
 Select nodes by box. More...
 
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. More...
 
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. More...
 

Function Documentation

int Vect_select_areas_by_box ( struct Map_info *  Map,
BOUND_BOX *  Box,
struct ilist *  list 
)

Select areas by box.

Select areas whose boxes overlap specified box!!! It means that selected area may or may not overlap the box.

Parameters
Mapvector map
Boxbounding box
[out]outputlist, must be initialized
Returns
number of areas

Definition at line 92 of file vector/Vlib/select.c.

References python.core::debug_level, dig_select_areas(), G__getenv(), G_debug(), NULL, and Vect_build_sidx_from_topo().

Referenced by Vect_find_area(), Vect_isle_find_area(), and Vedit_render_map().

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.

Polygons should be closed, i.e. first and last points must be identical.

Warning : values in list may be duplicate!

Parameters
Mapvector map
Polygonouter ring
nislesnumber of islands or 0
Islesarray of islands or NULL
[out]listoutput list, must be initialised
Returns
number of areas

Definition at line 308 of file vector/Vlib/select.c.

References dig_list_add(), G_debug(), NULL, Vect_find_area(), Vect_get_isle_area(), Vect_get_line_areas(), Vect_new_list(), and Vect_select_lines_by_polygon().

int Vect_select_isles_by_box ( struct Map_info *  Map,
BOUND_BOX *  Box,
struct ilist *  list 
)

Select isles by box.

Select isles whose boxes overlap specified box!!! It means that selected isle may or may not overlap the box.

Parameters
Mapvector map
Boxbounding box
[out]listoutput list, must be initialized
Returns
number of isles

Definition at line 143 of file vector/Vlib/select.c.

References dig_select_isles(), G_debug(), and Vect_build_sidx_from_topo().

Referenced by Vect_attach_isles(), and Vect_find_island().

int Vect_select_lines_by_box ( struct Map_info *  Map,
BOUND_BOX *  Box,
int  type,
struct ilist *  list 
)

Select lines by box.

Select lines whose boxes overlap specified box!!! It means that selected line may or may not overlap the box.

Parameters
Mapvector map
Boxbounding box
typeline type
[out]listoutput list, must be initialized
Returns
number of lines

Definition at line 38 of file vector/Vlib/select.c.

References dig_list_add(), dig_select_lines(), G_debug(), NULL, Vect_build_sidx_from_topo(), and Vect_new_list().

Referenced by wxdigit.IVDigit::OpenBackgroundMap(), Vect_attach_centroids(), Vect_break_lines_list(), Vect_find_line_list(), Vect_remove_duplicates(), Vect_select_lines_by_polygon(), and Vedit_render_map().

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.

Polygons should be closed, i.e. first and last points must be identical.

Parameters
Mapvector map
Polygonouter ring
nislesnumber of islands or 0
Islesarray of islands or NULL
typeline type
[out]listoutput list, must be initialised
Returns
number of lines

Definition at line 210 of file vector/Vlib/select.c.

References tools::box, dig_line_box(), dig_list_add(), G_debug(), NULL, Vect_line_check_intersection(), Vect_new_line_struct(), Vect_new_list(), Vect_point_in_poly(), Vect_read_line(), and Vect_select_lines_by_box().

Referenced by wxdisplay.DisplayDriver::SelectLinesByBox(), wxdigit.IVDigit::SelectLinesByQuery(), Vect_select_areas_by_polygon(), and Vedit_merge_lines().

int Vect_select_nodes_by_box ( struct Map_info *  Map,
BOUND_BOX *  Box,
struct ilist *  list 
)

Select nodes by box.

Parameters
Mapvector map
Boxbounding box
[out]listoutput list, must be initialized
Returns
number of nodes

Definition at line 171 of file vector/Vlib/select.c.

References dig_select_nodes(), G_debug(), and Vect_build_sidx_from_topo().

Referenced by Vect_find_node().