PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ RectTreeBuilder()

static int RectTreeBuilder ( const LWGEOM lwgeom,
GeomCache *  cache 
)
static

Builder, freeer and public accessor for cached RECT_NODE trees.

Definition at line 62 of file lwgeom_rectree.c.

63 {
64  RectTreeGeomCache *rect_cache = (RectTreeGeomCache*)cache;
65  RECT_NODE *tree = rect_tree_from_lwgeom(lwgeom);
66 
67  if ( rect_cache->index )
68  {
69  rect_tree_free(rect_cache->index);
70  rect_cache->index = 0;
71  }
72  if ( ! tree )
73  return LW_FAILURE;
74 
75  rect_cache->index = tree;
76  return LW_SUCCESS;
77 }
#define LW_FAILURE
Definition: liblwgeom.h:79
#define LW_SUCCESS
Definition: liblwgeom.h:80
RECT_NODE * rect_tree_from_lwgeom(const LWGEOM *lwgeom)
Create a tree index on top an LWGEOM.
Definition: lwtree.c:861
void rect_tree_free(RECT_NODE *node)
Recurse from top of node tree and free all children.
Definition: lwtree.c:69
RECT_NODE * index

References RectTreeGeomCache::index, LW_FAILURE, LW_SUCCESS, rect_tree_free(), and rect_tree_from_lwgeom().

Here is the call graph for this function: