PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_rect_tree_intersects_tree()

static void test_rect_tree_intersects_tree ( void  )
static

Definition at line 416 of file cu_measures.c.

417 {
418  /* total overlap, A == B */
419  CU_ASSERT_EQUAL(tree_inter(
420  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
421  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))"),
422  LW_TRUE
423  );
424 
425  /* hiding between the tines of the comb */
426  CU_ASSERT_EQUAL(tree_inter(
427  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
428  "POLYGON((0.3 0.7, 0.3 0.8, 0.4 0.8, 0.4 0.7, 0.3 0.7))"),
429  LW_FALSE
430  );
431 
432  /* between the tines, but with a corner overlapping */
433  CU_ASSERT_EQUAL(tree_inter(
434  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
435  "POLYGON((0.3 0.7, 0.3 0.8, 0.4 0.8, 1.3 0.3, 0.3 0.7))"),
436  LW_TRUE
437  );
438 
439  /* Just touching the top left corner of the comb */
440  CU_ASSERT_EQUAL(tree_inter(
441  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
442  "POLYGON((-1 5, 0 5, 0 7, -1 7, -1 5))"),
443  LW_TRUE
444  );
445 
446  /* Contained, complex */
447  CU_ASSERT_EQUAL(tree_inter(
448  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
449  "GEOMETRYCOLLECTION(MULTILINESTRING((1 2, 3 2)),POINT(1 2))"),
450  LW_TRUE
451  );
452 
453  /* Touching, complex */
454  CU_ASSERT_EQUAL(tree_inter(
455  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
456  "GEOMETRYCOLLECTION(MULTILINESTRING((6 3, 8 4)),POINT(5 3))"),
457  LW_TRUE
458  );
459 
460  /* Not Touching, complex */
461  CU_ASSERT_EQUAL(tree_inter(
462  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
463  "GEOMETRYCOLLECTION(MULTILINESTRING((6 3, 8 4)),POINT(1 3.5))"),
464  LW_FALSE
465  );
466 
467  /* Crossing, complex */
468  CU_ASSERT_EQUAL(tree_inter(
469  "POLYGON((0 0, 3 1, 0 2, 3 3, 0 4, 3 5, 0 6, 5 6, 5 0, 0 0))",
470  "GEOMETRYCOLLECTION(MULTILINESTRING((1.5 4.1, 1.6 2)),POINT(1 3.5))"),
471  LW_TRUE
472  );
473 }
static int tree_inter(const char *wkt1, const char *wkt2)
Definition: cu_measures.c:402
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76

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: