PostGIS  3.2.2dev-r@@SVN_REVISION@@

◆ test_rect_tree_intersects_tree()

static void test_rect_tree_intersects_tree ( void  )
static

Definition at line 506 of file cu_measures.c.

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

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: