PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwpoly_clone()

LWPOLY* lwpoly_clone ( const LWPOLY g)

Definition at line 213 of file lwpoly.c.

214 {
215  uint32_t i;
216  LWPOLY *ret = lwalloc(sizeof(LWPOLY));
217  memcpy(ret, g, sizeof(LWPOLY));
218  ret->rings = lwalloc(sizeof(POINTARRAY *)*g->nrings);
219  for ( i = 0; i < g->nrings; i++ ) {
220  ret->rings[i] = ptarray_clone(g->rings[i]);
221  }
222  if ( g->bbox ) ret->bbox = gbox_copy(g->bbox);
223  return ret;
224 }
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
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint32_t nrings
Definition: liblwgeom.h:458
GBOX * bbox
Definition: liblwgeom.h:456
unsigned int uint32_t
Definition: uthash.h:78

References LWPOLY::bbox, gbox_copy(), lwalloc(), LWPOLY::nrings, ptarray_clone(), and LWPOLY::rings.

Referenced by lwgeom_clone().

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