PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lw_dist2d_tri_circstring()

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

Definition at line 954 of file measures.c.

955 {
956  const POINT2D *pt = lw_curvering_getfirstpoint2d_cp((LWGEOM *)line);
957  if (ptarray_contains_point(tri->points, pt) != LW_OUTSIDE && dl->mode == DIST_MIN)
958  {
959  dl->distance = 0.0;
960  dl->p1.x = dl->p2.x = pt->x;
961  dl->p1.y = dl->p2.y = pt->y;
962  return LW_TRUE;
963  }
964 
965  return lw_dist2d_ptarray_ptarrayarc(tri->points, line->points, dl);
966 }
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
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:753
#define LW_OUTSIDE
static const POINT2D * lw_curvering_getfirstpoint2d_cp(LWGEOM *geom)
Definition: measures.c:887
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:1258
#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:507
POINTARRAY * points
Definition: liblwgeom.h:495
double y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390

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: