32 G_debug(1,
"Vect_spatial_index_init()");
48 G_debug(1,
"Vect_spatial_index_destroy()");
66 static int rect_init = 0;
73 G_debug(3,
"Vect_spatial_index_add_item(): id = %d",
id);
97 static int rect_init = 0;
104 G_debug(3,
"Vect_spatial_index_del_item(): id = %d",
id);
116 G_fatal_error(
_(
"Unable to delete item %d from spatial index"),
id);
141 static int rect_init = 0;
158 G_debug(3,
"Vect_spatial_index_select(): %d items selected",
161 return list->n_values;
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_ilist_add(struct ilist *, int)
Add item to ilist.
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_reset_list(struct ilist *)
Reset ilist structure.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
int SearchHitCallback(int id, const struct RTree_Rect *rect, void *arg)
unsigned char nsides_alloc
struct RTree * si_tree
Pointer to the search tree (R*-Tree)
void Vect_spatial_index_destroy(struct spatial_index *si)
Destroy existing spatial index.
void Vect_spatial_index_init(struct spatial_index *si, int with_z)
Initialize spatial index structure.
void Vect_spatial_index_del_item(struct spatial_index *si, int id, const struct bound_box *box)
Delete item from spatial index structure.
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.
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.
int RTreeDeleteRect(struct RTree_Rect *r, int tid, struct RTree *t)
Delete an item from a R*-Tree.
int RTreeInsertRect(struct RTree_Rect *r, int tid, struct RTree *t)
Insert an item into a R*-Tree.
void RTreeDestroyTree(struct RTree *t)
Destroy an R*-Tree.
int RTreeSearch(struct RTree *t, struct RTree_Rect *r, SearchHitCallback *shcb, void *cbarg)
Search an R*-Tree.
struct RTree * RTreeCreateTree(int fd, off_t rootpos, int ndims)
Create new empty R*-Tree.