* dimension, the appropriate ordinate values
* will be extracted from it
*
+ * N must be a valid point index
*/
extern void ptarray_set_point4d(POINTARRAY *pa, int n, const POINT4D *p4d);
#include <float.h>
#include <stdio.h>
#include <errno.h>
+#include <assert.h>
/*
* Lower this to reduce integrity checks
void
ptarray_set_point4d(POINTARRAY *pa, int n, const POINT4D *p4d)
{
+ assert(n >= 0 && n < pa->npoints);
uint8_t *ptr=getPoint_internal(pa, n);
switch ( FLAGS_GET_ZM(pa->flags) )
{
LWDEBUGF(5,"copying %d bytes to start vertex %d from start vertex %d", copy_size, where+1, where);
}
+ /* We have one more point */
+ ++pa->npoints;
+
/* Copy the new point into the gap */
ptarray_set_point4d(pa, where, p);
LWDEBUGF(5,"copying new point to start vertex %d", point_size, where);
- /* We have one more point */
- pa->npoints++;
-
return LW_SUCCESS;
}