40 #include <sys/types.h>
63 struct RTree *new_rtree;
88 sizeof(struct
RTree_Rect) + new_rtree->rectsize;
121 new_rtree->
nb[i][j].
pos = -1;
123 new_rtree->
used[i][j] = j;
129 for (k = 0; k <
MAXCARD; k++) {
137 lseek(new_rtree->
fd, rootpos, SEEK_SET);
183 for (i = 0; i <=
MAXCARD; i++) {
211 t->overflow = overflow != 0;
238 for (k = 0; k <
MAXCARD; k++) {
241 free(
t->nb[i][j].n.branch);
245 if (
t->free_nodes.alloc)
246 free(
t->free_nodes.pos);
264 for (i = 0; i <=
MAXCARD; i++) {
308 return t->search_rect(
t,
r, shcb, cbarg);
329 return t->insert_rect(
r, newchild, 0,
t);
355 return t->delete_rect(
r, child,
t);
int RTreeSearchM(struct RTree *, struct RTree_Rect *, SearchHitCallback *, void *)
int RTreeInsertRectF(struct RTree_Rect *, union RTree_Child, int, struct RTree *)
int RTreeDeleteRectM(struct RTree_Rect *, union RTree_Child, struct RTree *)
int RTreeSearchF(struct RTree *, struct RTree_Rect *, SearchHitCallback *, void *)
int RTreeInsertRectM(struct RTree_Rect *, union RTree_Child, int, struct RTree *)
int RTreeDeleteRectF(struct RTree_Rect *, union RTree_Child, struct RTree *)
int RTreeValidChildM(union RTree_Child *child)
int RTreeValidChildF(union RTree_Child *)
size_t RTreeWriteNode(struct RTree_Node *n, struct RTree *t)
#define assert(condition)
void RTreeFreeNode(struct RTree_Node *n)
struct RTree_Node * RTreeAllocNode(struct RTree *t, int level)
void RTreeDestroyNode(struct RTree_Node *n, int nodes)
RectReal * RTreeAllocBoundary(struct RTree *t)
Allocate the boundary array of a rectangle for a given tree.
void RTreeFreeBoundary(struct RTree_Rect *r)
Delete the boundary of a rectangle.
int SearchHitCallback(int id, const struct RTree_Rect *rect, void *arg)
struct RTree_Branch * branch
struct RTree_Rect cover[2]
unsigned char ndims_alloc
struct RTree::_recycle free_nodes
struct RTree_Rect rect_0 rect_1 upperrect orect
struct RTree_Branch tmpb1 tmpb2 c
struct RTree_Branch * BranchBuf
rt_delete_fn * delete_rect
rt_search_fn * search_rect
unsigned char nsides_alloc
rt_valid_child_fn * valid_child
rt_insert_fn * insert_rect
struct RTree_PartitionVars p
struct RTree_ListNode * RTreeNewListNode(void)
int RTreeDeleteRect(struct RTree_Rect *r, int tid, struct RTree *t)
Delete an item from a R*-Tree.
void RTreeSetOverflow(struct RTree *t, char overflow)
Enable/disable R*-tree forced reinsertion (overflow)
void RTreeFreeListNode(struct RTree_ListNode *p)
void RTreeReInsertNode(struct RTree_Node *n, struct RTree_ListNode **ee)
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.
void RTreeFreeListBranch(struct RTree_ListBranch *p)
#define MAXLEVEL
Maximum verbosity level.