GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
|
Vector library - spatial index. More...
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#include <grass/vector.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
void | Vect_spatial_index_init (struct spatial_index *si, int with_z) |
Initialize spatial index structure. More... | |
void | Vect_spatial_index_destroy (struct spatial_index *si) |
Destroy existing spatial index. More... | |
void | Vect_spatial_index_add_item (struct spatial_index *si, int id, const struct bound_box *box) |
Add a new item to spatial index structure. More... | |
void | Vect_spatial_index_del_item (struct spatial_index *si, int id, const struct bound_box *box) |
Delete item from spatial index structure. More... | |
int | Vect_spatial_index_select (const struct spatial_index *si, const struct bound_box *box, struct ilist *list) |
Select items by bounding box to list. More... | |
Vector library - spatial index.
Higher level functions for a custom spatial index.
(C) 2001-2009 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 vector/Vlib/select.c.
void Vect_spatial_index_add_item | ( | struct spatial_index * | si, |
int | id, | ||
const struct bound_box * | box | ||
) |
Add a new item to spatial index structure.
[in,out] | si | pointer to spatial index structure |
id | item identifier | |
box | pointer to item bounding box |
Definition at line 62 of file vector/Vlib/select.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, RTree::nsides_alloc, RTreeInsertRect(), bound_box::S, spatial_index::si_tree, bound_box::T, and bound_box::W.
void Vect_spatial_index_del_item | ( | struct spatial_index * | si, |
int | id, | ||
const struct bound_box * | box | ||
) |
Delete item from spatial index structure.
[in,out] | si | pointer to spatial index structure |
id | item identifier |
Definition at line 92 of file vector/Vlib/select.c.
References _, bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_fatal_error(), G_malloc, bound_box::N, RTree::nsides_alloc, RTreeDeleteRect(), bound_box::S, spatial_index::si_tree, bound_box::T, and bound_box::W.
void Vect_spatial_index_destroy | ( | struct 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 46 of file vector/Vlib/select.c.
References G_debug(), RTreeDestroyTree(), and spatial_index::si_tree.
void Vect_spatial_index_init | ( | struct spatial_index * | si, |
int | with_z | ||
) |
Initialize spatial index structure.
si | pointer to spatial index structure |
Definition at line 30 of file vector/Vlib/select.c.
References G_debug(), RTreeCreateTree(), and spatial_index::si_tree.
int Vect_spatial_index_select | ( | const struct spatial_index * | si, |
const struct bound_box * | box, | ||
struct ilist * | list | ||
) |
Select items by bounding box to list.
si | pointer to spatial index structure | |
box | bounding box | |
[out] | list | pointer to list where selected items are stored |
Definition at line 136 of file vector/Vlib/select.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_malloc, bound_box::N, RTree::nsides_alloc, RTreeSearch(), bound_box::S, spatial_index::si_tree, bound_box::T, Vect_reset_list(), and bound_box::W.