Insert a point into an existing POINTARRAY.
Zero is the index of the start of the array.
Definition at line 96 of file ptarray.c.
99 LWDEBUGF(5,
"pa = %p; p = %p; where = %d", pa, p, where);
104 lwerror(
"ptarray_insert_point: called on read-only point array");
111 lwerror(
"ptarray_insert_point: offset out of range (%d)", where);
138 if( where < pa->npoints )
140 size_t copy_size = point_size * (pa->
npoints - where);
142 LWDEBUGF(5,
"copying %d bytes to start vertex %d from start vertex %d", copy_size, where+1, where);
150 LWDEBUGF(5,
"copying new point to start vertex %d", point_size, where);
#define FLAGS_GET_READONLY(flags)
void * lwrealloc(void *mem, size_t size)
void * lwalloc(size_t size)
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
size_t ptarray_point_size(const POINTARRAY *pa)
uint8_t * serialized_pointlist
References POINTARRAY::flags, FLAGS_GET_READONLY, getPoint_internal(), LW_FAILURE, LW_SUCCESS, lwalloc(), LWDEBUGF, lwerror(), lwrealloc(), POINTARRAY::maxpoints, POINTARRAY::npoints, ptarray_point_size(), ptarray_set_point4d(), and POINTARRAY::serialized_pointlist.
Referenced by _lwt_AddPoint(), geography_centroid_from_mpoly(), lwline_add_lwpoint(), ptarray_append_point(), test_ptarray_insert_point(), and test_trim_bits().