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

◆ test_rect_tree_intersects_tree()

static void test_rect_tree_intersects_tree ( void  )
static

Definition at line 512 of file cu_measures.c.

513{
514 /* total overlap, A == B */
515 CU_ASSERT_EQUAL(tree_inter(
516 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
517 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))"),
518 LW_TRUE
519 );
520
521 /* hiding between the tines of the comb */
522 CU_ASSERT_EQUAL(tree_inter(
523 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
524 "POLYGON((0.3 0.7, 0.3 0.8, 0.4 0.8, 0.4 0.7, 0.3 0.7))"),
526 );
527
528 /* between the tines, but with a corner overlapping */
529 CU_ASSERT_EQUAL(tree_inter(
530 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
531 "POLYGON((0.3 0.7, 0.3 0.8, 0.4 0.8, 1.3 0.3, 0.3 0.7))"),
532 LW_TRUE
533 );
534
535 /* Just touching the top left corner of the comb */
536 CU_ASSERT_EQUAL(tree_inter(
537 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
538 "POLYGON((-1 5, 0 5, 0 7, -1 7, -1 5))"),
539 LW_TRUE
540 );
541
542 /* Contained, complex */
543 CU_ASSERT_EQUAL(tree_inter(
544 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
545 "GEOMETRYCOLLECTION(MULTILINESTRING((1 2, 3 2)),POINT(1 2))"),
546 LW_TRUE
547 );
548
549 /* Touching, complex */
550 CU_ASSERT_EQUAL(tree_inter(
551 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
552 "GEOMETRYCOLLECTION(MULTILINESTRING((6 3, 8 4)),POINT(5 3))"),
553 LW_TRUE
554 );
555
556 /* Not Touching, complex */
557 CU_ASSERT_EQUAL(tree_inter(
558 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
559 "GEOMETRYCOLLECTION(MULTILINESTRING((6 3, 8 4)),POINT(1 3.5))"),
561 );
562
563 /* Crossing, complex */
564 CU_ASSERT_EQUAL(tree_inter(
565 "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
566 "GEOMETRYCOLLECTION(MULTILINESTRING((1.5 4.1, 1.6 2)),POINT(1 3.5))"),
567 LW_TRUE
568 );
569}
static int tree_inter(const char *wkt1, const char *wkt2)
#define LW_FALSE
Definition liblwgeom.h:94
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:93

References LW_FALSE, LW_TRUE, and tree_inter().

Referenced by measures_suite_setup().

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