GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-535c39c9fc
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 121 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 317 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 165 of file sindex.c.

References Box, dig_select_isles(), G_debug(), and Map_info::plus.

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 32 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 220 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 187 of file sindex.c.

References Box, dig_select_nodes(), G_debug(), Map_info::plus, and Vect_reset_list().

Referenced by Vect_find_node().