PostGIS  3.4.0dev-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 800 of file measures3d.c.

801 {
802  PLANE3D plane;
803  LWDEBUG(2, "lw_dist3d_line_poly is called");
804 
805  if (dl->mode == DIST_MAX)
806  return lw_dist3d_ptarray_ptarray(line->points, poly->rings[0], dl);
807 
808  /* if polygon does not define a plane: Return distance line to line */
809  if (!define_plane(poly->rings[0], &plane))
810  return lw_dist3d_ptarray_ptarray(line->points, poly->rings[0], dl);
811 
812  return lw_dist3d_ptarray_poly(line->points, poly, &plane, dl);
813 }
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
int define_plane(POINTARRAY *pa, PLANE3D *pl)
Definition: measures3d.c:1448
int lw_dist3d_ptarray_poly(POINTARRAY *pa, LWPOLY *poly, PLANE3D *plane, DISTPTS3D *dl)
Computes pointarray to polygon distance.
Definition: measures3d.c:1290
int lw_dist3d_ptarray_ptarray(POINTARRAY *l1, POINTARRAY *l2, DISTPTS3D *dl)
Finds all combinations of segments between two pointarrays.
Definition: measures3d.c:1085
#define DIST_MAX
Definition: measures.h:43
int mode
Definition: measures3d.h:43
POINTARRAY * points
Definition: liblwgeom.h:483
POINTARRAY ** rings
Definition: liblwgeom.h:519

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

Referenced by lw_dist3d_distribute_bruteforce().

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