PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ lwpointiterator_peek()

int lwpointiterator_peek ( LWPOINTITERATOR s,
POINT4D p 
)

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 lwgeom_trim_bits_in_place(), lwpointiterator_next(), and test_mixed_rw_access().

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