PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ lwline_clone_deep()

LWLINE* lwline_clone_deep ( const LWLINE g)

Definition at line 118 of file lwline.c.

References LWLINE::bbox, LWLINE::flags, FLAGS_SET_READONLY, gbox_copy(), lwalloc(), LWDEBUGF, LWLINE::points, and ptarray_clone_deep().

Referenced by lwgeom_clone_deep(), lwline_split_by_mpoint(), lwline_split_by_point(), and lwline_unstroke().

119 {
120  LWLINE *ret = lwalloc(sizeof(LWLINE));
122  LWDEBUGF(2, "lwline_clone_deep called with %p", g);
123  memcpy(ret, g, sizeof(LWLINE));
125  if ( g->bbox ) ret->bbox = gbox_copy(g->bbox);
126  if ( g->points ) ret->points = ptarray_clone_deep(g->points);
127  FLAGS_SET_READONLY(ret->flags,0);
129  return ret;
130 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:433
GBOX * bbox
Definition: liblwgeom.h:422
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
Definition: ptarray.c:628
void * lwalloc(size_t size)
Definition: lwutil.c:229
uint8_t flags
Definition: liblwgeom.h:421
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
#define FLAGS_SET_READONLY(flags, value)
Definition: liblwgeom.h:149
Definition: liblwgeom.h:424
Here is the call graph for this function:
Here is the caller graph for this function: