100{
105
106 POSTGIS_DEBUGF(3, "tree1_type=%d", tree1_type);
107
108
110 {
111 POSTGIS_DEBUG(3, "tree is a polygon, using tree PiP");
112
114 {
116 POSTGIS_DEBUG(3, "unable to read gbox from gserialized, calculating from scratch");
119 }
120
121
124
125
127 {
128 POSTGIS_DEBUG(3, "in_point3d is not inside the tree gbox, CircTreePIP returning FALSE");
130 }
131
132 else
133 {
136 pt2d_inside.
x = in_point->
x;
137 pt2d_inside.
y = in_point->
y;
138
141 lwpgerror("%s: Unable to generate outside point!", __func__);
142
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);
144
145 POSTGIS_DEBUG(3, "calling circ_tree_contains_point for PiP test");
147 }
148 }
149 else
150 {
151 POSTGIS_DEBUG(3, "tree1 not polygonal, so CircTreePIP returning FALSE");
153 }
154}
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 *gbox)
Read the box from the GSERIALIZED or calculate it if necessary.
uint32_t gserialized_get_type(const GSERIALIZED *g)
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_get_point_outside(const CIRC_NODE *node, POINT2D *pt)
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.
Point in spherical coordinates on the world.