Function handling polygon to polygon calculation 1 if we are looking for maxdistance, just check the outer rings.
2 check if poly1 has first point outside poly2 and vice versa, if so, just check outer rings 3 check if first point of poly2 is in a hole of poly1. If so check outer ring of poly2 against that hole of poly1 4 check if first point of poly1 is in a hole of poly2. If so check outer ring of poly1 against that hole of poly2 5 If we have come all the way here we know that the first point of one of them is inside the other ones outer ring and not in holes so we check which one is inside.
Definition at line 968 of file measures.c.
969{
971
972 LWDEBUG(2,
"lw_dist2d_poly_poly called");
973
974
977
978
979
980
983 {
987 }
988
989
990
992 for (uint32_t i = 1; i < poly1->
nrings; i++)
995
996
997
999 for (uint32_t i = 1; i < poly2->
nrings; i++)
1002
1003
1004
1007 {
1010 }
1011
1014 {
1017 }
1018
1019 lwerror(
"Unspecified error in function lw_dist2d_poly_poly");
1021}
#define LW_TRUE
Return types for functions with status returns.
int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
The following is based on the "Fast Winding Number Inclusion of a Point in a Polygon" algorithm by Da...
#define LWDEBUG(level, msg)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static void lw_dist2d_distpts_set(DISTPTS *dl, double distance, const POINT2D *p1, const POINT2D *p2)
int lw_dist2d_ptarray_ptarray(POINTARRAY *l1, POINTARRAY *l2, DISTPTS *dl)
test each segment of l1 against each segment of l2.
References DIST_MAX, getPoint2d_cp(), lw_dist2d_distpts_set(), lw_dist2d_ptarray_ptarray(), LW_FALSE, LW_OUTSIDE, LW_TRUE, LWDEBUG, lwerror(), DISTPTS::mode, LWPOLY::nrings, ptarray_contains_point(), and LWPOLY::rings.
Referenced by lw_dist2d_distribute_bruteforce().