PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwline_clone()

LWLINE* lwline_clone ( const LWLINE lwgeom)

Definition at line 102 of file lwline.c.

103 {
104  LWLINE *ret = lwalloc(sizeof(LWLINE));
105 
106  LWDEBUGF(2, "lwline_clone called with %p", g);
107 
108  memcpy(ret, g, sizeof(LWLINE));
109 
110  ret->points = ptarray_clone(g->points);
111 
112  if ( g->bbox ) ret->bbox = gbox_copy(g->bbox);
113  return ret;
114 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:433
void * lwalloc(size_t size)
Definition: lwutil.c:229
POINTARRAY * ptarray_clone(const POINTARRAY *ptarray)
Clone a POINTARRAY object.
Definition: ptarray.c:659
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
GBOX * bbox
Definition: liblwgeom.h:423
POINTARRAY * points
Definition: liblwgeom.h:425

References LWLINE::bbox, gbox_copy(), lwalloc(), LWDEBUGF, LWLINE::points, and ptarray_clone().

Referenced by lwcircstring_clone(), lwgeom_clone(), lwline_chaikin(), lwline_set_effective_area(), and lwtriangle_clone().

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