PostGIS  2.2.7dev-r@@SVN_REVISION@@
LWLINE* lwline_clone_deep ( const LWLINE lwgeom)

Definition at line 105 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(), and lwline_split_by_point().

106 {
107  LWLINE *ret = lwalloc(sizeof(LWLINE));
109  LWDEBUGF(2, "lwline_clone_deep called with %p", g);
110  memcpy(ret, g, sizeof(LWLINE));
112  if ( g->bbox ) ret->bbox = gbox_copy(g->bbox);
113  if ( g->points ) ret->points = ptarray_clone_deep(g->points);
114  FLAGS_SET_READONLY(ret->flags,0);
116  return ret;
117 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:403
GBOX * bbox
Definition: liblwgeom.h:404
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
Definition: ptarray.c:634
void * lwalloc(size_t size)
Definition: lwutil.c:199
uint8_t flags
Definition: liblwgeom.h:403
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
#define FLAGS_SET_READONLY(flags, value)
Definition: liblwgeom.h:134
Definition: liblwgeom.h:406

Here is the call graph for this function:

Here is the caller graph for this function: