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

◆ lwpointiterator_modify_next()

int lwpointiterator_modify_next ( LWPOINTITERATOR s,
const POINT4D p 
)
extern

Attempts to replace the next point int the iterator with p, and advances the iterator to the next point.

Returns LW_SUCCESS if the assignment was successful, LW_FAILURE otherwise.

Definition at line 224 of file lwiterator.c.

225{
227 return LW_FAILURE;
228
229 if (!s->allow_modification)
230 {
231 lwerror("Cannot write to read-only iterator");
232 return LW_FAILURE;
233 }
234
235 POINTARRAY *pa = (POINTARRAY *)(s->pointarrays->item);
236 ptarray_set_point4d(pa, s->i, p);
237
239 return LW_SUCCESS;
240}
char * s
Definition cu_in_wkt.c:23
#define LW_FAILURE
Definition liblwgeom.h:96
#define LW_SUCCESS
Definition liblwgeom.h:97
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
Definition lwgeom_api.c:369
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static int lwpointiterator_advance(LWPOINTITERATOR *s)
Definition lwiterator.c:152
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, lwerror(), lwpointiterator_advance(), lwpointiterator_has_next(), ptarray_set_point4d(), and s.

Referenced by lwgeom_trim_bits_in_place(), rt_raster_copy_to_geometry(), test_cannot_modify_read_only(), test_mixed_rw_access(), and test_modification().

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