GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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

◆ Vect_select_areas_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.

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.

Referenced by Vect_find_area().

◆ Vect_select_areas_by_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.

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, Vect_new_list(), Vect_reset_list(), and Vect_select_lines_by_polygon().

◆ Vect_select_isles_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.

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().

◆ Vect_select_lines_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.

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

◆ Vect_select_lines_by_polygon()

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.

Referenced by Vect_select_areas_by_polygon().

◆ Vect_select_nodes_by_box()

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().