PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ rect_tree_ring_contains_point()

static int rect_tree_ring_contains_point ( RECT_NODE node,
const POINT2D pt,
int *  on_boundary 
)
static

Definition at line 314 of file lwtree.c.

315{
316 /* Only test nodes that straddle our stabline vertically */
317 /* and might be to the right horizontally */
318 if (node->ymin <= pt->y && pt->y <= node->ymax && pt->x <= node->xmax)
319 {
320 if (rect_node_is_leaf(node))
321 {
322 return rect_leaf_node_segment_side(&node->l, pt, on_boundary);
323 }
324 else
325 {
326 int i, r = 0;
327 for (i = 0; i < node->i.num_nodes; i++)
328 {
329 r += rect_tree_ring_contains_point(node->i.nodes[i], pt, on_boundary);
330 }
331 return r;
332 }
333 }
334 return 0;
335}
char * r
Definition cu_in_wkt.c:24
static int rect_leaf_node_segment_side(RECT_NODE_LEAF *node, const POINT2D *q, int *on_boundary)
Definition lwtree.c:199
static int rect_tree_ring_contains_point(RECT_NODE *node, const POINT2D *pt, int *on_boundary)
Definition lwtree.c:314
static int rect_node_is_leaf(const RECT_NODE *node)
Definition lwtree.c:31
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390
struct rect_node * nodes[RECT_NODE_SIZE]
Definition lwtree.h:61
double ymin
Definition lwtree.h:71
double xmax
Definition lwtree.h:70
double ymax
Definition lwtree.h:72
RECT_NODE_INTERNAL i
Definition lwtree.h:75
RECT_NODE_LEAF l
Definition lwtree.h:76

References rect_node::i, rect_node::l, RECT_NODE_INTERNAL::nodes, RECT_NODE_INTERNAL::num_nodes, r, rect_leaf_node_segment_side(), rect_node_is_leaf(), rect_tree_ring_contains_point(), POINT2D::x, rect_node::xmax, POINT2D::y, rect_node::ymax, and rect_node::ymin.

Referenced by rect_tree_area_contains_point(), and rect_tree_ring_contains_point().

Here is the call graph for this function:
Here is the caller graph for this function: