GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
Vector library - spatial index. More...
#include <stdlib.h>
#include <string.h>
#include <grass/glocale.h>
#include <grass/gis.h>
#include <grass/Vect.h>
Go to the source code of this file.
Functions | |
void | Vect_spatial_index_init (SPATIAL_INDEX *si) |
Init spatial index. More... | |
void | Vect_spatial_index_destroy (SPATIAL_INDEX *si) |
Destroy existing spatial index. More... | |
void | Vect_spatial_index_add_item (SPATIAL_INDEX *si, int id, BOUND_BOX *box) |
Add a new item to spatial index. More... | |
void | Vect_spatial_index_del_item (SPATIAL_INDEX *si, int id) |
Delete item from spatial index. More... | |
int | Vect_build_spatial_index (struct Map_info *Map) |
Create spatial index if necessary. More... | |
int | Vect_build_sidx_from_topo (struct Map_info *Map) |
Create spatial index from topo if necessary. More... | |
int | Vect_spatial_index_select (SPATIAL_INDEX *si, BOUND_BOX *box, struct ilist *list) |
Select items by bounding box to list. More... | |
Vector library - spatial index.
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2008 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.
Definition in file sindex.c.
int Vect_build_sidx_from_topo | ( | struct Map_info * | Map | ) |
Create spatial index from topo if necessary.
Map | pointer to vector map |
Definition at line 144 of file sindex.c.
References tools::box, dig_spidx_add_area(), dig_spidx_add_isle(), dig_spidx_add_line(), dig_spidx_add_node(), dig_spidx_init(), G_debug(), G_fatal_error(), and G_percent().
Referenced by Vect_build_spatial_index(), Vect_open_update(), Vect_select_areas_by_box(), Vect_select_isles_by_box(), Vect_select_lines_by_box(), Vect_select_nodes_by_box(), and Vect_spatial_index_dump().
int Vect_build_spatial_index | ( | struct Map_info * | Map | ) |
Create spatial index if necessary.
To be used in modules. Map must be opened on level 2.
Map | pointer to vector map |
out | print progress here |
Definition at line 124 of file sindex.c.
References G_fatal_error(), and Vect_build_sidx_from_topo().
void Vect_spatial_index_add_item | ( | SPATIAL_INDEX * | si, |
int | id, | ||
BOUND_BOX * | box | ||
) |
Add a new item to spatial index.
si | pointer to spatial index structure |
id | item identifier |
box | pointer to item bounding box |
Definition at line 66 of file sindex.c.
References Rect::boundary, G_debug(), and RTreeInsertRect().
void Vect_spatial_index_del_item | ( | SPATIAL_INDEX * | si, |
int | id | ||
) |
Delete item from spatial index.
si | pointer to spatial index structure |
id | item identifier |
Definition at line 89 of file sindex.c.
References G_debug(), G_fatal_error(), and RTreeDeleteRect().
void Vect_spatial_index_destroy | ( | SPATIAL_INDEX * | si | ) |
Destroy existing spatial index.
Vect_spatial_index_init() must be call before new use.
si | pointer to spatial index structure |
Definition at line 50 of file sindex.c.
References G_debug(), and RTreeDestroyNode().
void Vect_spatial_index_init | ( | SPATIAL_INDEX * | si | ) |
Init spatial index.
si | pointer to spatial index structure |
Definition at line 34 of file sindex.c.
References G_debug(), and RTreeNewIndex().
int Vect_spatial_index_select | ( | SPATIAL_INDEX * | si, |
BOUND_BOX * | box, | ||
struct ilist * | list | ||
) |
Select items by bounding box to list.
si | pointer to spatial index structure |
box | bounding box |
list | pointer to list where selected items are stored |
Definition at line 255 of file sindex.c.
References Rect::boundary, G_debug(), and RTreeSearch().