PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWLINE* lwline_clone ( const LWLINE lwgeom)

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_desegmentize(), lwline_simplify(), 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:362
GBOX * bbox
Definition: liblwgeom.h:376
POINTARRAY * ptarray_clone(const POINTARRAY *ptarray)
Clone a POINTARRAY object.
Definition: ptarray.c:643
void * lwalloc(size_t size)
Definition: lwutil.c:175
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: