PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lw_dist3d_line_poly()

int lw_dist3d_line_poly ( LWLINE line,
LWPOLY poly,
DISTPTS3D dl 
)

line to polygon calculation

Definition at line 641 of file measures3d.c.

References define_plane(), DIST_MAX, lw_dist3d_ptarray_poly(), lw_dist3d_ptarray_ptarray(), LW_FALSE, LWDEBUG, DISTPTS3D::mode, LWLINE::points, and LWPOLY::rings.

Referenced by lw_dist3d_distribute_bruteforce().

642 {
643  PLANE3D plane;
644  LWDEBUG(2, "lw_dist3d_line_poly is called");
645 
646  if (dl->mode == DIST_MAX)
647  {
648  return lw_dist3d_ptarray_ptarray(line->points, poly->rings[0], dl);
649  }
650 
651  if(!define_plane(poly->rings[0], &plane))
652  return LW_FALSE;
653 
654  return lw_dist3d_ptarray_poly(line->points, poly,&plane, dl);
655 }
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
#define LW_FALSE
Definition: liblwgeom.h:62
POINTARRAY ** rings
Definition: liblwgeom.h:441
int mode
Definition: measures3d.h:30
int define_plane(POINTARRAY *pa, PLANE3D *pl)
Here we define the plane of a polygon (boundary pointarray of a polygon) the plane is stored as a pon...
Definition: measures3d.c:1113
#define DIST_MAX
Definition: measures.h:16
int lw_dist3d_ptarray_ptarray(POINTARRAY *l1, POINTARRAY *l2, DISTPTS3D *dl)
Finds all combinationes of segments between two pointarrays.
Definition: measures3d.c:820
int lw_dist3d_ptarray_poly(POINTARRAY *pa, LWPOLY *poly, PLANE3D *plane, DISTPTS3D *dl)
Computes pointarray to polygon distance.
Definition: measures3d.c:1030
POINTARRAY * points
Definition: liblwgeom.h:406
Here is the call graph for this function:
Here is the caller graph for this function: