PostGIS  3.0.6dev-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 210 of file lwiterator.c.

211 {
213  return LW_FAILURE;
214 
215  /* If p is NULL, just advance without reading */
216  if (p && !lwpointiterator_peek(s, p))
217  return LW_FAILURE;
218 
220  return LW_SUCCESS;
221 }
char * s
Definition: cu_in_wkt.c:23
#define LW_FAILURE
Definition: liblwgeom.h:110
#define LW_SUCCESS
Definition: liblwgeom.h:111
static int lwpointiterator_advance(LWPOINTITERATOR *s)
Definition: lwiterator.c:152
int lwpointiterator_peek(LWPOINTITERATOR *s, POINT4D *p)
Attempts to assigns the next point in the iterator to p.
Definition: lwiterator.c:193
int lwpointiterator_has_next(LWPOINTITERATOR *s)
Returns LW_TRUE if there is another point available in the iterator.
Definition: lwiterator.c:202

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

Referenced by count_points_using_iterator(), lwgeom_calculate_mbc(), lwgeom_get_geos_coordseq_2d(), lwgeom_isfinite(), 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().

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