164 const GSERIALIZED *g1 = shared_gserialized_get(shared_g1);
165 const GSERIALIZED *g2 = shared_gserialized_get(shared_g2);
182 if ( tree_cache && tree_cache->
gcache.argnum && tree_cache->
index )
194 if ( tree_cache->
gcache.argnum == 1 )
198 geomtype_cached = type1;
201 else if ( tree_cache->
gcache.argnum == 2 )
205 geomtype_cached = type2;
210 lwpgerror(
"geography_distance_cache this cannot happen!");
218 if (
CircTreePIP(circtree_cached, g_cached, &p4d) )
static CircTreeGeomCache * GetCircTreeGeomCache(FunctionCallInfo fcinfo, SHARED_GSERIALIZED *g1, SHARED_GSERIALIZED *g2)
static int CircTreePIP(const CIRC_NODE *tree1, const GSERIALIZED *g1, const POINT4D *in_point)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
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)
static double distance(double x1, double y1, double x2, double y2)
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.