@d1 start location (distance from start / total distance) @d2 end location (distance from start / total distance)
1068 double length, slength, tlength;
1081 LWDEBUGF(3,
"Total length: %g", length);
1089 LWDEBUGF(3,
"From/To: %g/%g", from, to);
1095 for ( i = 0; i < nsegs; i++ )
1102 LWDEBUGF(3 ,
"Segment %d: (%g,%g,%g,%g)-(%g,%g,%g,%g)",
1103 i, p1.
x, p1.
y, p1.
z, p1.
m, p2.
x, p2.
y, p2.
z, p2.
m);
1117 if ( fabs ( from - ( tlength + slength ) ) <= tolerance )
1120 LWDEBUG(3,
" Second point is our start");
1130 else if ( fabs(from - tlength) <= tolerance )
1133 LWDEBUG(3,
" First point is our start");
1151 else if ( from > tlength + slength )
goto END;
1156 LWDEBUG(3,
" Seg contains first point");
1162 dseg = (from - tlength) / slength;
1184 if ( fabs(to - ( tlength + slength ) ) <= tolerance )
1187 LWDEBUG(3,
" Second point is our end");
1197 else if ( fabs(to - tlength) <= tolerance )
1200 LWDEBUG(3,
" First point is our end");
1211 else if ( to > tlength + slength )
1221 else if ( to < tlength + slength )
1224 LWDEBUG(3,
" Seg contains our end");
1226 dseg = (to - tlength) / slength;
1244 memcpy(&p1, &p2,
sizeof(
POINT4D));
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
void interpolate_point4d(const POINT4D *A, const POINT4D *B, POINT4D *I, double F)
Find interpolation point I between point A and point B so that the len(AI) == len(AB)*F and I falls o...
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
#define FLAGS_GET_M(flags)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
double ptarray_length_2d(const POINTARRAY *pts)
Find the 2d length of the given POINTARRAY (even if it's 3d)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int repeated_points)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...