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

◆ _lwt_DistinctVertexes2D()

static int _lwt_DistinctVertexes2D ( const POINTARRAY pa,
int  from,
int  dir,
POINT2D p0,
POINT2D p1 
)
static

Definition at line 40 of file lwt_edgeend.c.

41{
42 int i, toofar, inc;
43
44 if ( dir > 0 ) {
45 toofar = pa->npoints;
46 inc = 1;
47 } else {
48 toofar = -1;
49 inc = -1;
50 }
51
52 LWDEBUGF(1, "first point is index %d", from);
53 getPoint2d_p(pa, from, p0);
54 for ( i = from+inc; i != toofar; i += inc )
55 {
56 LWDEBUGF(1, "testing point %d", i);
57 getPoint2d_p(pa, i, p1); /* pick next point */
58 if ( P2D_SAME_STRICT(p0, p1) ) continue; /* equal to startpoint */
59 /* this is a good one, neither same of start nor of end point */
60 return 1; /* found */
61 }
62
63 /* no distinct vertices found */
64 return 0;
65}
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
Definition lwgeom_api.c:342
#define P2D_SAME_STRICT(a, b)
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:106
uint32_t npoints
Definition liblwgeom.h:427

References getPoint2d_p(), LWDEBUGF, POINTARRAY::npoints, and P2D_SAME_STRICT.

Referenced by lwt_edgeEnd_fromEdge().

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