1311 POINT4D start4d, end4d, projtmp;
1313 const POINT2D *start = NULL, *end = NULL;
1319 if ( ! proj4d ) proj4d = &projtmp;
1340 if (t==1 || dist < mindist )
1348 LWDEBUG(3,
"Breaking on mindist=0");
1355 if ( mindistout ) *mindistout = mindist;
1357 LWDEBUGF(3,
"Closest segment: %d", seg);
1358 LWDEBUGF(3,
"mindist: %g", mindist);
1380 LWDEBUGF(3,
"Closest point on segment: %g,%g", proj.
x, proj.
y);
1388 if ( tlen == 0 )
return 0;
1392 for (t=0; t<seg; t++, start=end)
1397 LWDEBUGF(4,
"Segment %d made plen %g", t, plen);
1402 LWDEBUGF(3,
"plen %g, tlen %g", plen, tlen);
#define LWDEBUG(level, msg)
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
The old function nessecary for ptarray_segmentize2d in ptarray.c.
double distance2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B)
The old function nessecary for ptarray_segmentize2d in ptarray.c.
int p2d_same(const POINT2D *p1, const POINT2D *p2)
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
void closest_point_on_segment(const POINT4D *p, const POINT4D *A, const POINT4D *B, POINT4D *ret)
double ptarray_length_2d(const POINTARRAY *pts)
Find the 2d length of the given POINTARRAY (even if it's 3d)
#define LWDEBUGF(level, msg,...)
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)