179 if ( tree_cache && tree_cache->
argnum && tree_cache->
index )
191 if ( tree_cache->
argnum == 1 )
195 geomtype_cached = type1;
198 else if ( tree_cache->
argnum == 2 )
202 geomtype_cached = type2;
207 lwpgerror(
"geography_distance_cache this cannot happen!");
215 if (
CircTreePIP(circtree_cached, g_cached, &p4d) )
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int circ_tree_get_point(const CIRC_NODE *node, POINT2D *pt)
Returns a POINT2D that is a vertex of the input shape.
int lwgeom_startpoint(const LWGEOM *lwgeom, POINT4D *pt)
void lwgeom_free(LWGEOM *geom)
double circ_tree_distance_tree(const CIRC_NODE *n1, const CIRC_NODE *n2, const SPHEROID *spheroid, double threshold)
CIRC_NODE * lwgeom_calculate_circ_tree(const LWGEOM *lwgeom)
static CircTreeGeomCache * GetCircTreeGeomCache(FunctionCallInfoData *fcinfo, const GSERIALIZED *g1, const GSERIALIZED *g2)
static int CircTreePIP(const CIRC_NODE *tree1, const GSERIALIZED *g1, const POINT4D *in_point)
Datum distance(PG_FUNCTION_ARGS)
void circ_tree_free(CIRC_NODE *node)
Recurse from top of node tree and free all children.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.