GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71793
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sindex.c File Reference

Vector library - select vector features. More...

#include <stdlib.h>
#include <grass/vector.h>
Include dependency graph for sindex.c:

Go to the source code of this file.

Functions

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. More...
 
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. More...
 
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. More...
 
int Vect_select_nodes_by_box (struct Map_info *Map, const struct 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...
 

Detailed Description

Vector library - select vector features.

Higher level functions for reading/writing/manipulating vectors.

(C) 2001-2011 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Radim Blazek, Markus Metz

Definition in file sindex.c.

Function Documentation

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.

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 125 of file sindex.c.

References Plus_head::Area, bound_box::B, dig_select_areas(), bound_box::E, G_debug(), G_getenv_nofatal(), boxlist::id, bound_box::N, boxlist::n_values, NULL, Map_info::plus, bound_box::S, bound_box::T, and bound_box::W.

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.

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 324 of file sindex.c.

References G_debug(), GV_BOUNDARY, ilist::n_values, NULL, ilist::value, Vect_find_area(), Vect_get_isle_area(), Vect_get_line_areas(), Vect_list_append(), Vect_new_list(), Vect_reset_list(), Vect_select_lines_by_polygon(), line_pnts::x, and line_pnts::y.

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.

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 171 of file sindex.c.

References bound_box::B, dig_select_isles(), bound_box::E, G_debug(), bound_box::N, boxlist::n_values, Map_info::plus, bound_box::S, bound_box::T, and bound_box::W.

Referenced by Vect_attach_isles(), and Vect_find_island().

int Vect_select_lines_by_box ( struct Map_info Map,
const struct bound_box Box,
int  type,
struct boxlist list 
)
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 228 of file sindex.c.

References bound_box::B, dig_line_box(), G_debug(), boxlist::id, line_pnts::n_points, ilist::n_values, boxlist::n_values, NULL, PORT_DOUBLE_MAX, bound_box::T, Vect_line_check_intersection(), Vect_list_append(), Vect_new_boxlist(), Vect_new_line_struct(), Vect_point_in_poly(), Vect_read_line(), Vect_reset_list(), Vect_select_lines_by_box(), line_pnts::x, and line_pnts::y.

Referenced by Vect_select_areas_by_polygon().

int Vect_select_nodes_by_box ( struct Map_info Map,
const struct 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 194 of file sindex.c.

References bound_box::B, dig_select_nodes(), bound_box::E, G_debug(), bound_box::N, ilist::n_values, Map_info::plus, bound_box::S, bound_box::T, Vect_reset_list(), and bound_box::W.

Referenced by Vect_find_node().