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

◆ ptarray_construct_copy_data()

POINTARRAY * ptarray_construct_copy_data ( char  hasz,
char  hasm,
uint32_t  npoints,
const uint8_t *  ptlist 
)

Construct a new POINTARRAY, copying in the data from ptlist.

Definition at line 305 of file ptarray.c.

306{
307 POINTARRAY *pa = lwalloc(sizeof(POINTARRAY));
308
309 pa->flags = lwflags(hasz, hasm, 0);
310 pa->npoints = npoints;
311 pa->maxpoints = npoints;
312
313 if ( npoints > 0 )
314 {
316 memcpy(pa->serialized_pointlist, ptlist, ptarray_point_size(pa) * npoints);
317 }
318 else
319 {
320 pa->serialized_pointlist = NULL;
321 }
322
323 return pa;
324}
void * lwalloc(size_t size)
Definition lwutil.c:227
lwflags_t lwflags(int hasz, int hasm, int geodetic)
Construct a new flags bitmask.
Definition lwutil.c:477
static size_t ptarray_point_size(const POINTARRAY *pa)
Definition lwinline.h:56
lwflags_t flags
Definition liblwgeom.h:431
uint32_t maxpoints
Definition liblwgeom.h:428
uint32_t npoints
Definition liblwgeom.h:427
uint8_t * serialized_pointlist
Definition liblwgeom.h:434

References POINTARRAY::flags, lwalloc(), lwflags(), POINTARRAY::maxpoints, POINTARRAY::npoints, ptarray_point_size(), and POINTARRAY::serialized_pointlist.

Referenced by lwpoint_from_wkb_state(), and ptarray_from_wkb_state().

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