Given a polygon1 check if all points of polygon2 are inside polygon1 and no intersections of the polygon edges occur.
return LW_TRUE if polygon is inside or on edge of polygon.
Definition at line 2602 of file lwgeodetic.c.
2603{
2604 uint32_t i;
2605
2606
2608 {
2609 LWDEBUG(4,
"returning false, geometry1 is empty or null");
2611 }
2612
2613
2615 {
2616 LWDEBUG(4,
"returning false, geometry2 is empty or null");
2618 }
2619
2620
2621 for (i = 0; i < poly2->nrings; i++)
2622 {
2623
2624
2625 if ( i % 2 == 0)
2626 {
2628 {
2629 LWDEBUG(4,
"returning false, geometry2 has point outside of geometry1");
2631 }
2632 }
2633 else
2634 {
2636 {
2637 LWDEBUG(4,
"returning false, geometry2 has point inside a hole of geometry1");
2639 }
2640 }
2641 }
2642
2643
2644 for (i = 0; i < poly2->nrings; i++)
2645 {
2647 {
2648 LWDEBUG(4,
"returning false, geometry2 is partially outside of geometry1");
2650 }
2651 }
2652
2653
2655}
#define LW_TRUE
Return types for functions with status returns.
int lwpoly_intersects_line(const LWPOLY *lwpoly, const POINTARRAY *line)
Checks if any edges of lwpoly intersect with the line formed by the pointarray return LW_TRUE if any ...
int lwpoly_covers_pointarray(const LWPOLY *lwpoly, const POINTARRAY *pta)
return LW_TRUE if all points are inside the polygon
#define LWDEBUG(level, msg)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
References LW_FALSE, LW_TRUE, LWDEBUG, lwgeom_is_empty(), lwpoly_covers_pointarray(), lwpoly_intersects_line(), LWPOLY::nrings, and LWPOLY::rings.
Referenced by lwgeom_covers_lwgeom_sphere().