106 POSTGIS_DEBUGF(3,
"tree1_type=%d", tree1_type);
111 POSTGIS_DEBUG(3,
"tree is a polygon, using tree PiP");
116 POSTGIS_DEBUG(3,
"unable to read gbox from gserialized, calculating from scratch");
128 POSTGIS_DEBUG(3,
"in_point3d is not inside the tree gbox, CircTreePIP returning FALSE");
136 pt2d_inside.
x = in_point->
x;
137 pt2d_inside.
y = in_point->
y;
141 lwpgerror(
"%s: Unable to generate outside point!", __func__);
143 POSTGIS_DEBUGF(3,
"p2d_inside=POINT(%g %g) p2d_outside=POINT(%g %g)", pt2d_inside.
x, pt2d_inside.
y, pt2d_outside.
x, pt2d_outside.
y);
145 POSTGIS_DEBUG(3,
"calling circ_tree_contains_point for PiP test");
151 POSTGIS_DEBUG(3,
"tree1 not polygonal, so CircTreePIP returning FALSE");
int gbox_contains_point3d(const GBOX *gbox, const POINT3D *pt)
Return true if the point is inside the gbox.
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box)
Read the bounding box off a serialization and calculate one if it is not already there.
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
void lwgeom_free(LWGEOM *geom)
int gbox_pt_outside(const GBOX *gbox, POINT2D *pt_outside)
Calculate a spherical point that falls outside the geocentric gbox.
int lwgeom_calculate_gbox_geodetic(const LWGEOM *geom, GBOX *gbox)
Calculate the geodetic bounding box for an LWGEOM.
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
int circ_tree_contains_point(const CIRC_NODE *node, const POINT2D *pt, const POINT2D *pt_outside, int *on_boundary)
Walk the tree and count intersections between the stab line and the edges.
int circ_tree_get_point_outside(const CIRC_NODE *node, POINT2D *pt)
Point in spherical coordinates on the world.