PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwline_clone_deep()

LWLINE* lwline_clone_deep ( const LWLINE lwgeom)

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(), and lwline_split_by_point().

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:438
GBOX * bbox
Definition: liblwgeom.h:420
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
Definition: ptarray.c:630
void * lwalloc(size_t size)
Definition: lwutil.c:229
uint8_t flags
Definition: liblwgeom.h:419
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
#define FLAGS_SET_READONLY(flags, value)
Definition: liblwgeom.h:150
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: