GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
index.h File Reference
#include "rtree.h"
Include dependency graph for index.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RTree_ListNode
 
struct  RTree_ListFNode
 
struct  RTree_ListBranch
 

Macros

#define PGSIZE   512
 
#define FORCECARD   3
 
#define NODETYPE(l, fd)   ((l) == 0 ? 0 : ((fd) < 0 ? 1 : 2))
 
#define RTreeCopyRect(r1, r2, t)   memcpy((r1)->boundary, (r2)->boundary, (t)->rectsize)
 

Functions

struct RTree_ListNodeRTreeNewListNode (void)
 
void RTreeFreeListNode (struct RTree_ListNode *)
 
void RTreeReInsertNode (struct RTree_Node *, struct RTree_ListNode **)
 
void RTreeFreeListBranch (struct RTree_ListBranch *)
 
int RTreeSearchM (struct RTree *, struct RTree_Rect *, SearchHitCallback *, void *)
 
int RTreeInsertRectM (struct RTree_Rect *, union RTree_Child, int, struct RTree *)
 
int RTreeDeleteRectM (struct RTree_Rect *, union RTree_Child, struct RTree *)
 
int RTreeValidChildM (union RTree_Child *child)
 
int RTreeSearchF (struct RTree *, struct RTree_Rect *, SearchHitCallback *, void *)
 
int RTreeInsertRectF (struct RTree_Rect *, union RTree_Child, int, struct RTree *)
 
int RTreeDeleteRectF (struct RTree_Rect *, union RTree_Child, struct RTree *)
 
int RTreeValidChildF (union RTree_Child *)
 
void RTreeNodeCover (struct RTree_Node *, struct RTree_Rect *, struct RTree *)
 
int RTreeAddBranch (struct RTree_Branch *, struct RTree_Node *, struct RTree_Node **, struct RTree_ListBranch **, struct RTree_Rect *, char *, struct RTree *)
 
int RTreePickBranch (struct RTree_Rect *, struct RTree_Node *, struct RTree *)
 
void RTreeDisconnectBranch (struct RTree_Node *, int, struct RTree *)
 
void RTreePrintNode (struct RTree_Node *, int, struct RTree *)
 
void RTreeTabIn (int)
 
void RTreeCopyBranch (struct RTree_Branch *, struct RTree_Branch *, struct RTree *)
 
void RTreeInitRect (struct RTree_Rect *, struct RTree *)
 Initialize a rectangle to have all 0 coordinates. More...
 
void RTreeNullRect (struct RTree_Rect *, struct RTree *)
 
RectReal RTreeRectArea (struct RTree_Rect *, struct RTree *)
 
RectReal RTreeRectSphericalVolume (struct RTree_Rect *, struct RTree *)
 
RectReal RTreeRectVolume (struct RTree_Rect *, struct RTree *)
 
RectReal RTreeRectMargin (struct RTree_Rect *, struct RTree *)
 
void RTreeCombineRect (struct RTree_Rect *, struct RTree_Rect *, struct RTree_Rect *, struct RTree *)
 
int RTreeExpandRect (struct RTree_Rect *, struct RTree_Rect *, struct RTree *)
 
int RTreeCompareRect (struct RTree_Rect *, struct RTree_Rect *, struct RTree *)
 
void RTreeSplitNode (struct RTree_Node *, struct RTree_Branch *, struct RTree_Node *, struct RTree *)
 
int RTreeSetNodeMax (int, struct RTree *)
 
int RTreeSetLeafMax (int, struct RTree *)
 
int RTreeGetNodeMax (struct RTree *)
 
int RTreeGetLeafMax (struct RTree *)
 
struct RTree_NodeRTreeGetNode (off_t, int, struct RTree *)
 
void RTreeNodeChanged (struct RTree_Node *, off_t, struct RTree *)
 
size_t RTreeRewriteNode (struct RTree_Node *, off_t, struct RTree *)
 
void RTreeAddNodePos (off_t, int, struct RTree *)
 

Macro Definition Documentation

◆ FORCECARD

#define FORCECARD   3

Definition at line 29 of file index.h.

◆ NODETYPE

#define NODETYPE (   l,
  fd 
)    ((l) == 0 ? 0 : ((fd) < 0 ? 1 : 2))

Definition at line 31 of file index.h.

◆ PGSIZE

#define PGSIZE   512

Definition at line 26 of file index.h.

◆ RTreeCopyRect

#define RTreeCopyRect (   r1,
  r2,
  t 
)    memcpy((r1)->boundary, (r2)->boundary, (t)->rectsize)

Definition at line 99 of file index.h.

Referenced by RTreeAddBranch(), RTreeCopyBranch(), and RTreeNodeCover().

Function Documentation

◆ RTreeAddBranch()

int RTreeAddBranch ( struct RTree_Branch ,
struct RTree_Node ,
struct RTree_Node **  ,
struct RTree_ListBranch **  ,
struct RTree_Rect ,
char *  ,
struct RTree  
)

◆ RTreeAddNodePos()

void RTreeAddNodePos ( off_t  ,
int  ,
struct RTree  
)

◆ RTreeCombineRect()

void RTreeCombineRect ( struct RTree_Rect ,
struct RTree_Rect ,
struct RTree_Rect ,
struct RTree  
)

◆ RTreeCompareRect()

int RTreeCompareRect ( struct RTree_Rect ,
struct RTree_Rect ,
struct RTree  
)

Definition at line 577 of file rect.c.

◆ RTreeCopyBranch()

void RTreeCopyBranch ( struct RTree_Branch ,
struct RTree_Branch ,
struct RTree  
)

Definition at line 126 of file node.c.

References RTree_Branch::child, RTree_Branch::rect, and RTreeCopyRect.

Referenced by RTreeCopyNode().

◆ RTreeDeleteRectF()

int RTreeDeleteRectF ( struct RTree_Rect ,
union RTree_Child  ,
struct RTree  
)

Definition at line 408 of file indexf.c.

References NULL.

Referenced by RTreeCreateTree().

◆ RTreeDeleteRectM()

int RTreeDeleteRectM ( struct RTree_Rect ,
union RTree_Child  ,
struct RTree  
)

Definition at line 354 of file indexm.c.

References NULL.

Referenced by RTreeCreateTree().

◆ RTreeDisconnectBranch()

void RTreeDisconnectBranch ( struct RTree_Node ,
int  ,
struct RTree  
)

Definition at line 270 of file node.c.

References assert, RTree_Node::branch, RTree_Branch::child, RTree::fd, and RTree::valid_child.

◆ RTreeExpandRect()

int RTreeExpandRect ( struct RTree_Rect ,
struct RTree_Rect ,
struct RTree  
)

Definition at line 542 of file rect.c.

References RTree_Rect::boundary, RTree::ndims, RTree::ndims_alloc, and Undefined.

Referenced by RTreeNodeCover().

◆ RTreeFreeListBranch()

void RTreeFreeListBranch ( struct RTree_ListBranch )

◆ RTreeFreeListNode()

void RTreeFreeListNode ( struct RTree_ListNode )

Definition at line 368 of file vector/rtree/index.c.

References free().

◆ RTreeGetLeafMax()

int RTreeGetLeafMax ( struct RTree )

Definition at line 42 of file card.c.

References RTree::leafcard.

◆ RTreeGetNode()

struct RTree_Node* RTreeGetNode ( off_t  ,
int  ,
struct RTree  
)

◆ RTreeGetNodeMax()

int RTreeGetNodeMax ( struct RTree )

Definition at line 38 of file card.c.

References RTree::nodecard.

◆ RTreeInitRect()

void RTreeInitRect ( struct RTree_Rect ,
struct RTree  
)

Initialize a rectangle to have all 0 coordinates.

Definition at line 112 of file rect.c.

References RTree_Rect::boundary, and RTree::ndims_alloc.

Referenced by RTreeSetRect1D(), RTreeSetRect2D(), RTreeSetRect3D(), and RTreeSetRect4D().

◆ RTreeInsertRectF()

int RTreeInsertRectF ( struct RTree_Rect ,
union RTree_Child  ,
int  ,
struct RTree  
)

Definition at line 214 of file indexf.c.

References b, MAXLEVEL, NULL, RTree::overflow, and RTreeAllocNode().

Referenced by RTreeCreateTree().

◆ RTreeInsertRectM()

int RTreeInsertRectM ( struct RTree_Rect ,
union RTree_Child  ,
int  ,
struct RTree  
)

Definition at line 186 of file indexm.c.

References b, MAXLEVEL, NULL, and RTree::overflow.

Referenced by RTreeCreateTree().

◆ RTreeNewListNode()

struct RTree_ListNode* RTreeNewListNode ( void  )

Definition at line 363 of file vector/rtree/index.c.

References malloc().

Referenced by RTreeReInsertNode().

◆ RTreeNodeChanged()

void RTreeNodeChanged ( struct RTree_Node ,
off_t  ,
struct RTree  
)

◆ RTreeNodeCover()

void RTreeNodeCover ( struct RTree_Node ,
struct RTree_Rect ,
struct RTree  
)

◆ RTreeNullRect()

void RTreeNullRect ( struct RTree_Rect ,
struct RTree  
)

Definition at line 227 of file rect.c.

References RTree_Rect::boundary, RTree::ndims_alloc, RTree::nsides_alloc, and r.

Referenced by RTreeInitPVars().

◆ RTreePickBranch()

int RTreePickBranch ( struct RTree_Rect ,
struct RTree_Node ,
struct RTree  
)

Definition at line 236 of file node.c.

References assert.

◆ RTreePrintNode()

void RTreePrintNode ( struct RTree_Node ,
int  ,
struct RTree  
)

◆ RTreeRectArea()

RectReal RTreeRectArea ( struct RTree_Rect ,
struct RTree  
)

◆ RTreeRectMargin()

RectReal RTreeRectMargin ( struct RTree_Rect ,
struct RTree  
)

Definition at line 487 of file rect.c.

References RTree_Rect::boundary, RTree::ndims, and RTree::ndims_alloc.

◆ RTreeRectSphericalVolume()

RectReal RTreeRectSphericalVolume ( struct RTree_Rect ,
struct RTree  
)

◆ RTreeRectVolume()

RectReal RTreeRectVolume ( struct RTree_Rect ,
struct RTree  
)

◆ RTreeReInsertNode()

void RTreeReInsertNode ( struct RTree_Node ,
struct RTree_ListNode **   
)

◆ RTreeRewriteNode()

size_t RTreeRewriteNode ( struct RTree_Node ,
off_t  ,
struct RTree  
)

Definition at line 190 of file io.c.

References RTree::fd, and RTreeWriteNode().

Referenced by RTreeFlushBuffer(), and RTreeGetNode().

◆ RTreeSearchF()

int RTreeSearchF ( struct RTree ,
struct RTree_Rect ,
SearchHitCallback ,
void *   
)

Definition at line 37 of file indexf.c.

Referenced by RTreeCreateTree().

◆ RTreeSearchM()

int RTreeSearchM ( struct RTree ,
struct RTree_Rect ,
SearchHitCallback ,
void *   
)

Definition at line 34 of file indexm.c.

Referenced by RTreeCreateTree().

◆ RTreeSetLeafMax()

int RTreeSetLeafMax ( int  ,
struct RTree  
)

Definition at line 34 of file card.c.

◆ RTreeSetNodeMax()

int RTreeSetNodeMax ( int  ,
struct RTree  
)

Definition at line 30 of file card.c.

◆ RTreeSplitNode()

void RTreeSplitNode ( struct RTree_Node ,
struct RTree_Branch ,
struct RTree_Node ,
struct RTree  
)

Definition at line 600 of file split.c.

References RTree_Node::level.

◆ RTreeTabIn()

void RTreeTabIn ( int  )

Definition at line 602 of file node.c.

Referenced by RTreePrintNode().

◆ RTreeValidChildF()

int RTreeValidChildF ( union RTree_Child )

Definition at line 27 of file indexf.c.

References RTree_Child::pos.

Referenced by RTreeCreateTree().

◆ RTreeValidChildM()

int RTreeValidChildM ( union RTree_Child child)

Definition at line 24 of file indexm.c.

References NULL, and RTree_Child::ptr.

Referenced by RTreeCreateTree().