PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwpointiterator_next()

int lwpointiterator_next ( LWPOINTITERATOR s,
POINT4D p 
)

Attempts to assign the next point in the iterator to p, and advances the iterator to the next point.

If p is NULL, the iterator will be advanced without reading a point. Returns LW_SUCCESS if the assignment was successful, LW_FAILURE otherwise.

Definition at line 212 of file lwiterator.c.

References LW_FAILURE, LW_SUCCESS, lwpointiterator_advance(), lwpointiterator_has_next(), and lwpointiterator_peek().

Referenced by count_points_using_iterator(), lwgeom_calculate_mbc(), lwgeom_get_geos_coordseq_2d(), lwline_from_lwgeom_array(), lwmpoint_from_lwgeom(), mbc_test(), test_mixed_rw_access(), test_modification(), test_no_memory_leaked_when_iterator_is_partially_used(), and test_ordering().

213 {
214  if (!lwpointiterator_has_next(s))
215  return LW_FAILURE;
216 
217  /* If p is NULL, just advance without reading */
218  if (p && !lwpointiterator_peek(s, p))
219  return LW_FAILURE;
220 
222  return LW_SUCCESS;
223 }
#define LW_SUCCESS
Definition: liblwgeom.h:80
int lwpointiterator_peek(LWPOINTITERATOR *s, POINT4D *p)
Attempts to assigns the next point in the iterator to p.
Definition: lwiterator.c:195
static int lwpointiterator_advance(LWPOINTITERATOR *s)
Definition: lwiterator.c:154
#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
Here is the call graph for this function:
Here is the caller graph for this function: