GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
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 100 of file index.h.

Function Documentation

◆ RTreeAddBranch()

int RTreeAddBranch ( struct RTree_Branch b,
struct RTree_Node n,
struct RTree_Node **  newnode,
struct RTree_ListBranch **  ee,
struct RTree_Rect cover,
char *  overflow,
struct RTree t 
)

◆ RTreeAddNodePos()

void RTreeAddNodePos ( off_t  pos,
int  level,
struct RTree t 
)

Definition at line 31 of file io.c.

References assert, NODE_BUFFER_SIZE, and t.

◆ RTreeCombineRect()

void RTreeCombineRect ( struct RTree_Rect r1,
struct RTree_Rect r2,
struct RTree_Rect r3,
struct RTree t 
)

Definition at line 500 of file rect.c.

References RTree_Rect::boundary, MAX, MIN, t, and Undefined.

◆ RTreeCompareRect()

int RTreeCompareRect ( struct RTree_Rect r,
struct RTree_Rect s,
struct RTree t 
)

Definition at line 570 of file rect.c.

◆ RTreeCopyBranch()

void RTreeCopyBranch ( struct RTree_Branch b1,
struct RTree_Branch b2,
struct RTree t 
)

Definition at line 124 of file node.c.

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

Referenced by RTreeCopyNode().

◆ RTreeDeleteRectF()

int RTreeDeleteRectF ( struct RTree_Rect r,
union RTree_Child  child,
struct RTree t 
)

Definition at line 408 of file indexf.c.

References NULL.

Referenced by RTreeCreateTree().

◆ RTreeDeleteRectM()

int RTreeDeleteRectM ( struct RTree_Rect r,
union RTree_Child  child,
struct RTree t 
)

Definition at line 352 of file indexm.c.

References NULL.

Referenced by RTreeCreateTree().

◆ RTreeDisconnectBranch()

void RTreeDisconnectBranch ( struct RTree_Node n,
int  i,
struct RTree t 
)

Definition at line 270 of file node.c.

References assert, RTree_Node::branch, RTree_Branch::child, and t.

◆ RTreeExpandRect()

int RTreeExpandRect ( struct RTree_Rect r1,
struct RTree_Rect r2,
struct RTree t 
)

Definition at line 536 of file rect.c.

References RTree_Rect::boundary, t, and Undefined.

Referenced by RTreeNodeCover().

◆ RTreeFreeListBranch()

void RTreeFreeListBranch ( struct RTree_ListBranch p)

◆ RTreeFreeListNode()

void RTreeFreeListNode ( struct RTree_ListNode p)

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

References free().

◆ RTreeGetLeafMax()

int RTreeGetLeafMax ( struct RTree t)

Definition at line 44 of file card.c.

References t.

◆ RTreeGetNode()

struct RTree_Node* RTreeGetNode ( off_t  nodepos,
int  level,
struct RTree t 
)

Definition at line 111 of file io.c.

References RTree_Node::level, NODE_BUFFER_SIZE, RTreeReadNode(), RTreeRewriteNode(), and t.

◆ RTreeGetNodeMax()

int RTreeGetNodeMax ( struct RTree t)

Definition at line 39 of file card.c.

References t.

◆ RTreeInitRect()

void RTreeInitRect ( struct RTree_Rect r,
struct RTree t 
)

Initialize a rectangle to have all 0 coordinates.

Definition at line 109 of file rect.c.

References r, and t.

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

◆ RTreeInsertRectF()

int RTreeInsertRectF ( struct RTree_Rect r,
union RTree_Child  child,
int  level,
struct RTree t 
)

Definition at line 213 of file indexf.c.

References b, MAXLEVEL, NULL, RTreeAllocNode(), and t.

Referenced by RTreeCreateTree().

◆ RTreeInsertRectM()

int RTreeInsertRectM ( struct RTree_Rect r,
union RTree_Child  child,
int  level,
struct RTree t 
)

Definition at line 185 of file indexm.c.

References b, MAXLEVEL, NULL, and t.

Referenced by RTreeCreateTree().

◆ RTreeNewListNode()

struct RTree_ListNode* RTreeNewListNode ( void  )

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

References malloc().

Referenced by RTreeReInsertNode().

◆ RTreeNodeChanged()

void RTreeNodeChanged ( struct RTree_Node n,
off_t  nodepos,
struct RTree t 
)

Definition at line 201 of file io.c.

References assert, RTree_Node::level, NODE_BUFFER_SIZE, and t.

◆ RTreeNodeCover()

void RTreeNodeCover ( struct RTree_Node n,
struct RTree_Rect r,
struct RTree t 
)

◆ RTreeNullRect()

void RTreeNullRect ( struct RTree_Rect r,
struct RTree t 
)

Definition at line 225 of file rect.c.

References r, and t.

Referenced by RTreeInitPVars().

◆ RTreePickBranch()

int RTreePickBranch ( struct RTree_Rect r,
struct RTree_Node n,
struct RTree t 
)

Definition at line 236 of file node.c.

References assert.

◆ RTreePrintNode()

void RTreePrintNode ( struct RTree_Node n,
int  depth,
struct RTree t 
)

Definition at line 619 of file node.c.

◆ RTreeRectArea()

RectReal RTreeRectArea ( struct RTree_Rect ,
struct RTree  
)

◆ RTreeRectMargin()

RectReal RTreeRectMargin ( struct RTree_Rect r,
struct RTree t 
)

Definition at line 483 of file rect.c.

References r, and t.

◆ RTreeRectSphericalVolume()

RectReal RTreeRectSphericalVolume ( struct RTree_Rect r,
struct RTree t 
)

Definition at line 432 of file rect.c.

References r, t, Undefined, and UnitSphereVolumes.

◆ RTreeRectVolume()

RectReal RTreeRectVolume ( struct RTree_Rect R,
struct RTree t 
)

Definition at line 323 of file rect.c.

References assert, r, t, and Undefined.

◆ RTreeReInsertNode()

void RTreeReInsertNode ( struct RTree_Node n,
struct RTree_ListNode **  ee 
)

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

References l, and RTreeNewListNode().

◆ RTreeRewriteNode()

size_t RTreeRewriteNode ( struct RTree_Node n,
off_t  nodepos,
struct RTree t 
)

Definition at line 193 of file io.c.

References RTreeWriteNode(), and t.

Referenced by RTreeFlushBuffer(), and RTreeGetNode().

◆ RTreeSearchF()

int RTreeSearchF ( struct RTree t,
struct RTree_Rect r,
SearchHitCallback shcb,
void *  cbarg 
)

Definition at line 36 of file indexf.c.

Referenced by RTreeCreateTree().

◆ RTreeSearchM()

int RTreeSearchM ( struct RTree t,
struct RTree_Rect r,
SearchHitCallback shcb,
void *  cbarg 
)

Definition at line 33 of file indexm.c.

Referenced by RTreeCreateTree().

◆ RTreeSetLeafMax()

int RTreeSetLeafMax ( int  new_max,
struct RTree t 
)

Definition at line 34 of file card.c.

◆ RTreeSetNodeMax()

int RTreeSetNodeMax ( int  new_max,
struct RTree t 
)

Definition at line 29 of file card.c.

◆ RTreeSplitNode()

void RTreeSplitNode ( struct RTree_Node n,
struct RTree_Branch b,
struct RTree_Node nn,
struct RTree t 
)

Definition at line 613 of file split.c.

References RTree_Node::level.

◆ RTreeTabIn()

void RTreeTabIn ( int  depth)

Definition at line 604 of file node.c.

◆ RTreeValidChildF()

int RTreeValidChildF ( union RTree_Child child)

Definition at line 26 of file indexf.c.

References RTree_Child::pos.

Referenced by RTreeCreateTree().

◆ RTreeValidChildM()

int RTreeValidChildM ( union RTree_Child child)

Definition at line 23 of file indexm.c.

References NULL, and RTree_Child::ptr.

Referenced by RTreeCreateTree().