PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwline_clone_deep()

LWLINE* lwline_clone_deep ( const LWLINE lwgeom)

Definition at line 118 of file lwline.c.

119 {
120  LWLINE *ret = lwalloc(sizeof(LWLINE));
121 
122  LWDEBUGF(2, "lwline_clone_deep called with %p", g);
123  memcpy(ret, g, sizeof(LWLINE));
124 
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);
128 
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
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
#define FLAGS_SET_READONLY(flags, value)
Definition: liblwgeom.h:150
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
GBOX * bbox
Definition: liblwgeom.h:423
uint8_t flags
Definition: liblwgeom.h:422
POINTARRAY * points
Definition: liblwgeom.h:425

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().

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