PostGIS  2.1.10dev-r@@SVN_REVISION@@
POINTARRAY* ptarray_clone_deep ( const POINTARRAY ptarray)

Deep clone a pointarray (also clones serialized pointlist)

Definition at line 619 of file ptarray.c.

References POINTARRAY::flags, FLAGS_SET_READONLY, lwalloc(), LWDEBUG, POINTARRAY::maxpoints, POINTARRAY::npoints, ptarray_point_size(), and POINTARRAY::serialized_pointlist.

Referenced by lwcurvepoly_construct_from_lwpoly(), lwcurvepoly_segmentize(), LWGEOM_dump_rings(), lwline_clone_deep(), lwmcurve_segmentize(), lwmsurface_segmentize(), lwpoly_clone_deep(), lwpoly_from_lwlines(), lwtriangle_from_lwline(), parse_gml_coord(), parse_gml_pos(), parse_gml_poslist(), parse_kml_coordinates(), and ptarray_remove_repeated_points().

620 {
621  POINTARRAY *out = lwalloc(sizeof(POINTARRAY));
622  size_t size;
623 
624  LWDEBUG(3, "ptarray_clone_deep called.");
625 
626  out->flags = in->flags;
627  out->npoints = in->npoints;
628  out->maxpoints = in->npoints;
629 
630  FLAGS_SET_READONLY(out->flags, 0);
631 
632  size = in->npoints * ptarray_point_size(in);
633  out->serialized_pointlist = lwalloc(size);
634  memcpy(out->serialized_pointlist, in->serialized_pointlist, size);
635 
636  return out;
637 }
uint8_t * serialized_pointlist
Definition: liblwgeom.h:322
int ptarray_point_size(const POINTARRAY *pa)
Definition: ptarray.c:41
int npoints
Definition: liblwgeom.h:327
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
uint8_t flags
Definition: liblwgeom.h:325
int maxpoints
Definition: liblwgeom.h:328
void * lwalloc(size_t size)
Definition: lwutil.c:175
#define FLAGS_SET_READONLY(flags, value)
Definition: liblwgeom.h:116

Here is the call graph for this function:

Here is the caller graph for this function: