PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ CircTreeBuilder()

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

Builder, freeer and public accessor for cached CIRC_NODE trees.

Definition at line 46 of file geography_measurement_trees.c.

47 {
48  CircTreeGeomCache* circ_cache = (CircTreeGeomCache*)cache;
49  CIRC_NODE* tree = lwgeom_calculate_circ_tree(lwgeom);
50 
51  if ( circ_cache->index )
52  {
53  circ_tree_free(circ_cache->index);
54  circ_cache->index = 0;
55  }
56  if ( ! tree )
57  return LW_FAILURE;
58 
59  circ_cache->index = tree;
60  return LW_SUCCESS;
61 }
#define LW_FAILURE
Definition: liblwgeom.h:79
#define LW_SUCCESS
Definition: liblwgeom.h:80
void circ_tree_free(CIRC_NODE *node)
Recurse from top of node tree and free all children.
CIRC_NODE * lwgeom_calculate_circ_tree(const LWGEOM *lwgeom)
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.

References circ_tree_free(), CircTreeGeomCache::index, LW_FAILURE, LW_SUCCESS, and lwgeom_calculate_circ_tree().

Here is the call graph for this function: