PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwpointiterator_peek()

int lwpointiterator_peek ( LWPOINTITERATOR s,

Attempts to assigns the next point in the iterator to p.

Does not advance. Returns LW_SUCCESS if the assignment was successful, LW_FAILURE otherwise.

Definition at line 195 of file lwiterator.c.

References getPoint4d_p(), LWPOINTITERATOR::i, LISTNODE::item, LW_FAILURE, lwpointiterator_has_next(), and LWPOINTITERATOR::pointarrays.

Referenced by lwpointiterator_next(), and test_mixed_rw_access().

196 {
197  if (!lwpointiterator_has_next(s))
198  return LW_FAILURE;
200  return getPoint4d_p(s->pointarrays->item, s->i, p);
201 }
LISTNODE * pointarrays
Definition: lwiterator.c:47
#define LW_FAILURE
Definition: liblwgeom.h:79
int lwpointiterator_has_next(LWPOINTITERATOR *s)
Returns LW_TRUE if there is another point available in the iterator.
Definition: lwiterator.c:204
uint32_t i
Definition: lwiterator.c:48
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:122
void * item
Definition: lwiterator.c:32
Here is the call graph for this function:
Here is the caller graph for this function: