PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ lw_dist2d_tri_circstring()

int lw_dist2d_tri_circstring ( LWTRIANGLE tri,
LWCIRCSTRING line,
DISTPTS dl 
)

Definition at line 953 of file measures.c.

954 {
955  const POINT2D *pt = lw_curvering_getfirstpoint2d_cp((LWGEOM *)line);
956  if (ptarray_contains_point(tri->points, pt) != LW_OUTSIDE && dl->mode == DIST_MIN)
957  {
958  dl->distance = 0.0;
959  dl->p1.x = dl->p2.x = pt->x;
960  dl->p1.y = dl->p2.y = pt->y;
961  return LW_TRUE;
962  }
963 
964  return lw_dist2d_ptarray_ptarrayarc(tri->points, line->points, dl);
965 }
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:107
int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
Return 1 if the point is inside the POINTARRAY, -1 if it is outside, and 0 if it is on the boundary.
Definition: ptarray.c:732
#define LW_OUTSIDE
static const POINT2D * lw_curvering_getfirstpoint2d_cp(LWGEOM *geom)
Definition: measures.c:886
int lw_dist2d_ptarray_ptarrayarc(const POINTARRAY *pa, const POINTARRAY *pb, DISTPTS *dl)
Test each segment of pa against each arc of pb for distance.
Definition: measures.c:1257
#define DIST_MIN
Definition: measures.h:44
POINT2D p1
Definition: measures.h:52
POINT2D p2
Definition: measures.h:53
int mode
Definition: measures.h:54
double distance
Definition: measures.h:51
POINTARRAY * points
Definition: liblwgeom.h:493
POINTARRAY * points
Definition: liblwgeom.h:481
double y
Definition: liblwgeom.h:376
double x
Definition: liblwgeom.h:376

References DIST_MIN, DISTPTS::distance, lw_curvering_getfirstpoint2d_cp(), lw_dist2d_ptarray_ptarrayarc(), LW_OUTSIDE, LW_TRUE, DISTPTS::mode, DISTPTS::p1, DISTPTS::p2, LWTRIANGLE::points, LWCIRCSTRING::points, ptarray_contains_point(), POINT2D::x, and POINT2D::y.

Referenced by lw_dist2d_distribute_bruteforce().

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