Computes point to polygon distance For mindistance that means: 1) find the plane of the polygon 2) projecting the point to the plane of the polygon 3) finding if that projected point is inside the polygon, if so the distance is measured to that projected point 4) if not in polygon above, check the distance against the boundary of the polygon for max distance it is always point against boundary.
Definition at line 778 of file measures3d.c.
779{
782 LWDEBUG(2,
"lw_dist3d_point_poly is called");
784
785
788
789
791 {
792
794 }
795
796
798
800}
int getPoint3dz_p(const POINTARRAY *pa, uint32_t n, POINT3DZ *point)
#define LWDEBUG(level, msg)
static double project_point_on_plane(const POINT3DZ *p, PLANE3D *pl, POINT3DZ *p0)
Finds a point on a plane from where the original point is perpendicular to the plane.
int lw_dist3d_pt_ptarray(const POINT3DZ *p, const POINTARRAY *pa, DISTPTS3D *dl)
search all the segments of pointarray to see which one is closest to p Returns distance between point...
int lw_dist3d_pt_poly(const POINT3DZ *p, const LWPOLY *poly, PLANE3D *plane, POINT3DZ *projp, DISTPTS3D *dl)
Checking if the point projected on the plane of the polygon actually is inside that polygon.
int define_plane(const POINTARRAY *pa, PLANE3D *pl)
References define_plane(), DIST_MAX, getPoint3dz_p(), lw_dist3d_pt_poly(), lw_dist3d_pt_ptarray(), LWDEBUG, DISTPTS3D::mode, LWPOINT::point, project_point_on_plane(), and LWPOLY::rings.
Referenced by lw_dist3d_distribute_bruteforce().