PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ rect_tree_intersects_tree()

int rect_tree_intersects_tree ( RECT_NODE tree1,
RECT_NODE tree2 
)

Test if two RECT_NODE trees intersect one another.

Definition at line 990 of file lwtree.c.

991 {
992  /*
993  * It is possible for an area to intersect another object
994  * without any edges intersecting, if the object is fully contained.
995  * If that is so, then any point in the object will be contained,
996  * so we do a quick point-in-poly test first for those cases
997  */
998  if (rect_tree_is_area(n1) &&
1000  {
1001  return LW_TRUE;
1002  }
1003 
1004  if (rect_tree_is_area(n2) &&
1006  {
1007  return LW_TRUE;
1008  }
1009 
1010  /*
1011  * Not contained, so intersection can only happen if
1012  * edges actually intersect.
1013  */
1014  return rect_tree_intersects_tree_recursive(n1, n2);
1015 }
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
static int rect_tree_intersects_tree_recursive(RECT_NODE *n1, RECT_NODE *n2)
Definition: lwtree.c:936
int rect_tree_contains_point(RECT_NODE *node, const POINT2D *pt)
Definition: lwtree.c:398
static int rect_tree_is_area(const RECT_NODE *node)
Definition: lwtree.c:436
static const POINT2D * rect_tree_get_point(const RECT_NODE *node)
Definition: lwtree.c:897

References LW_TRUE, rect_tree_contains_point(), rect_tree_get_point(), rect_tree_intersects_tree_recursive(), and rect_tree_is_area().

Referenced by tree_inter().

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