152 SHARED_GSERIALIZED *shared_geom1 = ToastCacheGetGeometry(fcinfo, 0);
153 SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1);
154 const GSERIALIZED *g1 = shared_gserialized_get(shared_geom1);
155 const GSERIALIZED *g2 = shared_gserialized_get(shared_geom2);
174 if (tree_cache && tree_cache->
gcache.argnum)
178 if (tree_cache->
gcache.argnum == 1)
183 else if (tree_cache->
gcache.argnum == 2)
190 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.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
#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, SHARED_GSERIALIZED *g1, SHARED_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.