159 PG_FREE_IF_COPY(g1, 0);
160 PG_FREE_IF_COPY(g2, 1);
174 if (tree_cache && tree_cache->
gcache.argnum)
178 if (tree_cache->
gcache.argnum == 1)
182 else if (tree_cache->
gcache.argnum == 2)
188 elog(ERROR,
"reached unreachable block in %s", __func__);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
double lwgeom_mindistance2d(const LWGEOM *lw1, const LWGEOM *lw2)
Function initializing min distance calculation.
static RectTreeGeomCache * GetRectTreeGeomCache(FunctionCallInfo fcinfo, const GSERIALIZED *g1, const GSERIALIZED *g2)
RECT_NODE * rect_tree_from_lwgeom(const LWGEOM *lwgeom)
Create a tree index on top an LWGEOM.
double rect_tree_distance_tree(RECT_NODE *n1, RECT_NODE *n2, double threshold)
Return the distance between two RECT_NODE trees.