PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwline_is_trajectory()

int lwline_is_trajectory ( const LWLINE geom)
extern

Definition at line 454 of file lwline.c.

455{
456 POINT3DM p;
457 int i, n;
458 double m = -1 * FLT_MAX;
459
460 if ( ! FLAGS_GET_M(line->flags) ) {
461 lwnotice("Line does not have M dimension");
462 return LW_FALSE;
463 }
464
465 n = line->points->npoints;
466 if ( n < 2 ) return LW_TRUE; /* empty or single-point are "good" */
467
468 for (i=0; i<n; ++i) {
469 getPoint3dm_p(line->points, i, &p);
470 if ( p.m <= m ) {
471 lwnotice("Measure of vertex %d (%g) not bigger than measure of vertex %d (%g)",
472 i, p.m, i-1, m);
473 return LW_FALSE;
474 }
475 m = p.m;
476 }
477
478 return LW_TRUE;
479}
#define LW_FALSE
Definition liblwgeom.h:108
#define FLAGS_GET_M(flags)
Definition liblwgeom.h:180
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:107
int getPoint3dm_p(const POINTARRAY *pa, uint32_t n, POINT3DM *point)
Definition lwgeom_api.c:268
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition lwutil.c:177
double m
Definition liblwgeom.h:394

References LWLINE::flags, FLAGS_GET_M, getPoint3dm_p(), LW_FALSE, LW_TRUE, lwnotice(), POINT3DM::m, POINTARRAY::npoints, and LWLINE::points.

Referenced by lwgeom_is_trajectory().

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