PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_rect_tree_intersects_tree()

static void test_rect_tree_intersects_tree ( void  )
static

Definition at line 491 of file cu_measures.c.

492 {
493  /* total overlap, A == B */
494  CU_ASSERT_EQUAL(tree_inter(
495  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
496  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))"),
497  LW_TRUE
498  );
499 
500  /* hiding between the tines of the comb */
501  CU_ASSERT_EQUAL(tree_inter(
502  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
503  "POLYGON((0.3 0.7, 0.3 0.8, 0.4 0.8, 0.4 0.7, 0.3 0.7))"),
504  LW_FALSE
505  );
506 
507  /* between the tines, but with a corner overlapping */
508  CU_ASSERT_EQUAL(tree_inter(
509  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
510  "POLYGON((0.3 0.7, 0.3 0.8, 0.4 0.8, 1.3 0.3, 0.3 0.7))"),
511  LW_TRUE
512  );
513 
514  /* Just touching the top left corner of the comb */
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((-1 5, 0 5, 0 7, -1 7, -1 5))"),
518  LW_TRUE
519  );
520 
521  /* Contained, complex */
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  "GEOMETRYCOLLECTION(MULTILINESTRING((1 2, 3 2)),POINT(1 2))"),
525  LW_TRUE
526  );
527 
528  /* Touching, complex */
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  "GEOMETRYCOLLECTION(MULTILINESTRING((6 3, 8 4)),POINT(5 3))"),
532  LW_TRUE
533  );
534 
535  /* Not Touching, complex */
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  "GEOMETRYCOLLECTION(MULTILINESTRING((6 3, 8 4)),POINT(1 3.5))"),
539  LW_FALSE
540  );
541 
542  /* Crossing, 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.5 4.1, 1.6 2)),POINT(1 3.5))"),
546  LW_TRUE
547  );
548 }
static int tree_inter(const char *wkt1, const char *wkt2)
Definition: cu_measures.c:477
#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: