PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwpoint_clone()

LWPOINT* lwpoint_clone ( const LWPOINT lwgeom)

Definition at line 208 of file lwpoint.c.

References LWPOINT::bbox, gbox_copy(), lwalloc(), LWDEBUG, LWPOINT::point, and ptarray_clone().

Referenced by lwgeom_clone(), lwmpoint_clip_to_ordinate_range(), lwmpoint_locate_along(), lwmpoint_remove_repeated_points(), lwpoint_clip_to_ordinate_range(), lwpoint_locate_along(), and lwpoint_locate_between_m().

209 {
210  LWPOINT *ret = lwalloc(sizeof(LWPOINT));
211 
212  LWDEBUG(2, "lwpoint_clone called");
213 
214  memcpy(ret, g, sizeof(LWPOINT));
215 
216  ret->point = ptarray_clone(g->point);
217 
218  if ( g->bbox ) ret->bbox = gbox_copy(g->bbox);
219  return ret;
220 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:403
POINTARRAY * ptarray_clone(const POINTARRAY *ptarray)
Clone a POINTARRAY object.
Definition: ptarray.c:658
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
POINTARRAY * point
Definition: liblwgeom.h:395
GBOX * bbox
Definition: liblwgeom.h:393
void * lwalloc(size_t size)
Definition: lwutil.c:199
Here is the call graph for this function:
Here is the caller graph for this function: