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

◆ test_itree_multipoly_empty()

static void test_itree_multipoly_empty ( void  )
static

Definition at line 533 of file cu_tree.c.

534{
535
536 /* outside empty */
537 const char *wktPoly = "POLYGON EMPTY";
538 test_itree_once(wktPoly, 2.0, 2.0, ITREE_OUTSIDE);
539
540 /* outside empty */
541 wktPoly = "MULTIPOLYGON EMPTY";
542 test_itree_once(wktPoly, 2.0, 2.0, ITREE_OUTSIDE);
543
544 /* outside collection of empty */
545 wktPoly = "MULTIPOLYGON(EMPTY, EMPTY, EMPTY)";
546 test_itree_once(wktPoly, 2.0, 2.0, ITREE_OUTSIDE);
547
548 /* mixed collection of empty and not */
549 wktPoly =
550 "MULTIPOLYGON(EMPTY,"
551 "((-10 -10, 6 -10, 7 -10, 7.5 2, 8 -10, 9 -10, 10 -10, 10 10, -10 10, -10 2, -10 2, -10 -10),"
552 "(-5 -5, -5 5, 5 5, 5 -5, -5 -5)))";
553
554 /* inside hole */
555 test_itree_once(wktPoly, 2.0, 2.0, ITREE_OUTSIDE);
556 /* inside hole */
557 test_itree_once(wktPoly, -2.0, -2.0, ITREE_OUTSIDE);
558 /* left of spike */
559 test_itree_once(wktPoly, 6.0, -2.0, ITREE_INSIDE);
560 /* right of spike */
561 test_itree_once(wktPoly, 9.0, -2.0, ITREE_INSIDE);
562 /* left of tip of spike */
563 test_itree_once(wktPoly, 6.0, 2.0, ITREE_INSIDE);
564 /* right of tip of spike */
565 test_itree_once(wktPoly, 9.0, 2.0, ITREE_INSIDE);
566 /* on spike tip */
567 test_itree_once(wktPoly, 7.5, 2.0, ITREE_BOUNDARY);
568 /* left of dupe vertex */
569 test_itree_once(wktPoly, -11, 2.0, ITREE_OUTSIDE);
570 /* right of dupe vertex */
571 test_itree_once(wktPoly, 11, 2.0, ITREE_OUTSIDE);
572
573 /* mixed collection of empty, empty in middle */
574 wktPoly =
575 "MULTIPOLYGON("
576 "((-10 -10, 6 -10, 7 -10, 7.5 2, 8 -10, 9 -10, 10 -10, 10 10, -10 10, -10 2, -10 2, -10 -10),"
577 "(-5 -5, -5 5, 5 5, 5 -5, -5 -5)),"
578 "EMPTY, ((-1 -1, 1 -1, 1 1, -1 1, -1 -1)))";
579
580 /* inside poly in hole */
581 test_itree_once(wktPoly, 0.0, 0.0, ITREE_INSIDE);
582 /* inside hole */
583 test_itree_once(wktPoly, 2.0, 2.0, ITREE_OUTSIDE);
584 /* inside hole */
585 test_itree_once(wktPoly, -2.0, -2.0, ITREE_OUTSIDE);
586 /* left of spike */
587 test_itree_once(wktPoly, 6.0, -2.0, ITREE_INSIDE);
588 /* right of spike */
589 test_itree_once(wktPoly, 9.0, -2.0, ITREE_INSIDE);
590 /* left of tip of spike */
591 test_itree_once(wktPoly, 6.0, 2.0, ITREE_INSIDE);
592 /* right of tip of spike */
593 test_itree_once(wktPoly, 9.0, 2.0, ITREE_INSIDE);
594 /* on spike tip */
595 test_itree_once(wktPoly, 7.5, 2.0, ITREE_BOUNDARY);
596 /* left of dupe vertex */
597 test_itree_once(wktPoly, -11, 2.0, ITREE_OUTSIDE);
598 /* right of dupe vertex */
599 test_itree_once(wktPoly, 11, 2.0, ITREE_OUTSIDE);
600}
static void test_itree_once(const char *polyWkt, double x, double y, IntervalTreeResult iexp)
Definition cu_tree.c:442
@ ITREE_BOUNDARY
@ ITREE_INSIDE
@ ITREE_OUTSIDE

References ITREE_BOUNDARY, ITREE_INSIDE, ITREE_OUTSIDE, and test_itree_once().

Referenced by tree_suite_setup().

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