1251 double maxdist2 = maxdist * maxdist;
1256 lwerror(
"Both input geometries must have a measure dimension");
1265 lwerror(
"Both input geometries must be linestrings");
1272 lwerror(
"Both input lines must have at least 2 points");
1292 LWDEBUG(1,
"Inputs never exist at the same time");
1300 mvals =
lwalloc(
sizeof(
double) *
1311 nmvals =
uniq(mvals, nmvals);
1316 double t0 = mvals[0];
1318 LWDEBUGF(1,
"Inputs only exist both at a single time (%g)", t0);
1321 lwnotice(
"Could not find point with M=%g on first geom", t0);
1326 lwnotice(
"Could not find point with M=%g on second geom", t0);
1339 for (i=1; i<nmvals; ++i)
1341 double t0 = mvals[i-1];
1342 double t1 = mvals[i];
1343 #if POSTGIS_DEBUG_LEVEL >= 1
1353 if ( -1 == seg )
continue;
1357 if ( -1 == seg )
continue;
1361 if ( -1 == seg )
continue;
1365 if ( -1 == seg )
continue;
1368 #if POSTGIS_DEBUG_LEVEL >= 1
1379 dist2 = ( q0.
x - p0.
x ) * ( q0.
x - p0.
x ) +
1380 ( q0.
y - p0.
y ) * ( q0.
y - p0.
y ) +
1381 ( q0.
z - p0.
z ) * ( q0.
z - p0.
z );
1382 if ( dist2 <= maxdist2 )
1384 LWDEBUGF(1,
"Within distance %g at time %g, breaking", sqrt(dist2), t);
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
double distance3d_pt_pt(const POINT3D *p1, const POINT3D *p2)
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate bounding box of a geometry, automatically taking into account whether it is cartesian or ge...
void * lwalloc(size_t size)
#define LW_TRUE
Return types for functions with status returns.
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
static int ptarray_collect_mvals(const POINTARRAY *pa, double tmin, double tmax, double *mvals)
static int compare_double(const void *pa, const void *pb)
static double segments_tcpa(POINT4D *p0, const POINT4D *p1, POINT4D *q0, const POINT4D *q1, double t0, double t1)
static int ptarray_locate_along_linear(const POINTARRAY *pa, double m, POINT4D *p, uint32_t from)
static int uniq(double *vals, int nvals)