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 2652 of file lwgeodetic.c.
2653{
2654 uint32_t i, j;
2659
2660
2662 {
2663 LWDEBUG(4,
"returning false, first point of line2 is not covered by line1");
2665 }
2666
2667
2669 {
2670 LWDEBUG(4,
"returning false, last point of line2 is not covered by line1");
2672 }
2673
2674 j = 0;
2675 i = 0;
2676 while (i < lwline1->points->npoints - 1 && j < lwline2->points->npoints - 1)
2677 {
2683
2687
2688
2690 {
2692 }
2694 {
2695
2697 j++;
2699 }
2700
2704
2705
2707 i++;
2709 }
2710
2711
2713 {
2714 LWDEBUG(4,
"returning false, found point not covered by both lines");
2716 }
2717 else
2718 {
2719 continue;
2720 }
2721 }
2722
2723
2725 {
2727 }
2728
2729
2730 i++;
2731 }
2732
2733
2735}
LWPOINT * lwline_get_lwpoint(const LWLINE *line, uint32_t where)
Returns freshly allocated LWPOINT that corresponds to the index where.
#define LW_TRUE
Return types for functions with status returns.
int lwline_covers_lwpoint(const LWLINE *lwline, const LWPOINT *lwpoint)
return LW_TRUE if any of the line segments covers the point
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
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)
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Two-point great circle segment from a to b.
Point in spherical coordinates on the world.
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().