Walk the tree and count intersections between the stab line and the edges.
odd => containment, even => no containment. KNOWN PROBLEM: Grazings (think of a sharp point, just touching the stabline) will be counted for one, which will throw off the count.
Definition at line 495 of file lwgeodetic_tree.c.
518 LWDEBUGF(3,
"edge_distance_to_point=%g, node_radius=%g", d, node->
radius);
521 LWDEBUGF(3,
"entering this branch (%p)", node);
537 LWDEBUG(3,
" got stab line edge_intersection with this edge!");
543 LWDEBUG(3,
" rejecting stab line grazing by left-side edge");
548 LWDEBUG(3,
" accepting stab line intersection");
559 LWDEBUG(3,
"internal node calculation");
560 LWDEBUGF(3,
" calling circ_tree_contains_point on child %d!", i);
568 LWDEBUGF(3,
"skipping this branch (%p)", node);
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
uint32_t edge_intersects(const POINT3D *A1, const POINT3D *A2, const POINT3D *B1, const POINT3D *B2)
Returns non-zero if edges A and B interact.
double edge_distance_to_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest)
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
#define PIR_B_TOUCH_RIGHT
static int circ_node_is_leaf(const CIRC_NODE *node)
Internal nodes have their point references set to NULL.
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.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
Two-point great circle segment from a to b.
Point in spherical coordinates on the world.
struct circ_node ** nodes
References circ_node::center, circ_node_is_leaf(), edge_distance_to_point(), edge_intersects(), circ_node::edge_num, GEOGRAPHIC_EDGE::end, FP_LTEQ, geog2cart(), geographic_point_init(), GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, LWDEBUG, LWDEBUGF, circ_node::nodes, circ_node::num_nodes, circ_node::p1, circ_node::p2, PIR_B_TOUCH_RIGHT, PIR_COLINEAR, PIR_INTERSECTS, rad2deg, circ_node::radius, GEOGRAPHIC_EDGE::start, POINT2D::x, and POINT2D::y.
Referenced by circ_tree_distance_tree_internal(), CircTreePIP(), test_tree_circ_pip(), and test_tree_circ_pip2().