PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ test_rect_tree_intersects_tree()

static void test_rect_tree_intersects_tree ( void  )
static

Definition at line 499 of file cu_measures.c.

500 {
501  /* total overlap, A == B */
502  CU_ASSERT_EQUAL(tree_inter(
503  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
504  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))"),
505  LW_TRUE
506  );
507 
508  /* hiding between the tines of the comb */
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.3 0.7, 0.3 0.8, 0.4 0.8, 0.4 0.7, 0.3 0.7))"),
512  LW_FALSE
513  );
514 
515  /* between the tines, but with a corner overlapping */
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, 1.3 0.3, 0.3 0.7))"),
519  LW_TRUE
520  );
521 
522  /* Just touching the top left corner of the comb */
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((-1 5, 0 5, 0 7, -1 7, -1 5))"),
526  LW_TRUE
527  );
528 
529  /* Contained, complex */
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  "GEOMETRYCOLLECTION(MULTILINESTRING((1 2, 3 2)),POINT(1 2))"),
533  LW_TRUE
534  );
535 
536  /* Touching, 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((6 3, 8 4)),POINT(5 3))"),
540  LW_TRUE
541  );
542 
543  /* Not 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(1 3.5))"),
547  LW_FALSE
548  );
549 
550  /* Crossing, 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((1.5 4.1, 1.6 2)),POINT(1 3.5))"),
554  LW_TRUE
555  );
556 }
static int tree_inter(const char *wkt1, const char *wkt2)
Definition: cu_measures.c:485
#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: