Check if first and last point of line2 are covered by line1 and then each point in between has to be one line1 in the exact same order return LW_TRUE if all edge points of line2 are on line1.
Definition at line 2769 of file lwgeodetic.c.
References edge_contains_point(), GEOGRAPHIC_EDGE::end, geographic_point_init(), getPoint2d_cp(), LW_FALSE, LW_TRUE, LWDEBUG, lwline_covers_lwpoint(), lwline_get_lwpoint(), POINTARRAY::npoints, LWLINE::points, GEOGRAPHIC_EDGE::start, POINT2D::x, and POINT2D::y.
Referenced by lwgeom_covers_lwgeom_sphere().
2780 LWDEBUG(4,
"returning false, first point of line2 is not covered by line1");
2787 LWDEBUG(4,
"returning false, last point of line2 is not covered by line1");
2793 while (i < lwline1->points->npoints - 1 && j < lwline2->points->npoints - 1)
2831 LWDEBUG(4,
"returning false, found point not covered by both lines");
Two-point great circle segment from a to b.
int edge_contains_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *p)
Returns true if the point p is on the minor edge defined by the end points of e.
#define LWDEBUG(level, msg)
Point in spherical coordinates on the world.
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
#define LW_TRUE
Return types for functions with status returns.
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
LWPOINT * lwline_get_lwpoint(const LWLINE *line, int where)
Returns freshly allocated LWPOINT that corresponds to the index where.
int lwline_covers_lwpoint(const LWLINE *lwline, const LWPOINT *lwpoint)
return LW_TRUE if any of the line segments covers the point