111 POSTGIS_DEBUGF(3,
"tree1_type=%d", tree1_type);
116 POSTGIS_DEBUG(3,
"tree is a polygon, using tree PiP");
121 POSTGIS_DEBUG(3,
"unable to read gbox from gserialized, calculating from scratch");
133 POSTGIS_DEBUG(3,
"in_point3d is not inside the tree gbox, CircTreePIP returning FALSE");
141 pt2d_inside.
x = in_point->
x;
142 pt2d_inside.
y = in_point->
y;
146 lwpgerror(
"%s: Unable to generate outside point!", __func__);
148 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);
150 POSTGIS_DEBUG(3,
"calling circ_tree_contains_point for PiP test");
156 POSTGIS_DEBUG(3,
"tree1 not polygonal, so CircTreePIP returning FALSE");
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...
int lwgeom_calculate_gbox_geodetic(const LWGEOM *geom, GBOX *gbox)
Calculate the geodetic bounding box for an LWGEOM.
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
int gbox_contains_point3d(const GBOX *gbox, const POINT3D *pt)
Return true if the point is inside the gbox.
Point in spherical coordinates on the world.
int circ_tree_contains_point(const CIRC_NODE *node, const POINT2D *pt, const POINT2D *pt_outside, int level, 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)
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesion coordinates on unit sphere.
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
int gbox_pt_outside(const GBOX *gbox, POINT2D *pt_outside)
Calculate a spherical point that falls outside the geocentric gbox.