PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwline_clone()

LWLINE* lwline_clone ( const LWLINE g)

Definition at line 89 of file lwline.c.

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

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

90 {
91  LWLINE *ret = lwalloc(sizeof(LWLINE));
92 
93  LWDEBUGF(2, "lwline_clone called with %p", g);
94 
95  memcpy(ret, g, sizeof(LWLINE));
96 
97  ret->points = ptarray_clone(g->points);
98 
99  if ( g->bbox ) ret->bbox = gbox_copy(g->bbox);
100  return ret;
101 }
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(const POINTARRAY *ptarray)
Clone a POINTARRAY object.
Definition: ptarray.c:658
void * lwalloc(size_t size)
Definition: lwutil.c:199
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
POINTARRAY * points
Definition: liblwgeom.h:406
Here is the call graph for this function:
Here is the caller graph for this function: