180 if ( tree_cache && tree_cache->
gcache.argnum && tree_cache->
index )
192 if ( tree_cache->
gcache.argnum == 1 )
196 geomtype_cached = type1;
199 else if ( tree_cache->
gcache.argnum == 2 )
203 geomtype_cached = type2;
208 lwpgerror(
"geography_distance_cache this cannot happen!");
216 if (
CircTreePIP(circtree_cached, g_cached, &p4d) )
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
static CircTreeGeomCache * GetCircTreeGeomCache(FunctionCallInfo fcinfo, const GSERIALIZED *g1, const GSERIALIZED *g2)
static int CircTreePIP(const CIRC_NODE *tree1, const GSERIALIZED *g1, const POINT4D *in_point)
int lwgeom_startpoint(const LWGEOM *lwgeom, POINT4D *pt)
void lwgeom_free(LWGEOM *geom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
double circ_tree_distance_tree(const CIRC_NODE *n1, const CIRC_NODE *n2, const SPHEROID *spheroid, double threshold)
int circ_tree_get_point(const CIRC_NODE *node, POINT2D *pt)
Returns a POINT2D that is a vertex of the input shape.
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)
Datum distance(PG_FUNCTION_ARGS)
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.