PostGIS  2.5.0dev-r@@SVN_REVISION@@
LWGEOM* lwgeom_clone_deep ( const LWGEOM lwgeom)

Deep clone an LWGEOM, everything is copied.

Deep clone an LWGEOM, everything is copied.

POINTARRAY are copied.

Definition at line 513 of file lwgeom.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, lwcollection_clone_deep(), LWDEBUGF, lwerror(), lwline_clone_deep(), lwpoly_clone_deep(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by _lwt_AddLineEdge(), _lwt_split_by_nodes(), lwcollection_clone_deep(), LWGEOM_addpoint(), lwgeom_clip_by_rect(), lwgeom_difference(), lwgeom_grid(), lwgeom_intersection(), lwgeom_remove_repeated_points(), lwgeom_reverse(), lwgeom_segmentize_sphere(), lwgeom_simplify(), lwgeom_split_wrapx(), lwgeom_subdivide_recursive(), lwgeom_symdifference(), lwgeom_unaryunion(), lwgeom_union(), lwgeom_wrapx(), and rt_raster_surface().

514 {
515  LWDEBUGF(2, "lwgeom_clone called with %p, %s",
516  lwgeom, lwtype_name(lwgeom->type));
517 
518  switch (lwgeom->type)
519  {
520  case POINTTYPE:
521  case LINETYPE:
522  case CIRCSTRINGTYPE:
523  case TRIANGLETYPE:
524  return (LWGEOM *)lwline_clone_deep((LWLINE *)lwgeom);
525  case POLYGONTYPE:
526  return (LWGEOM *)lwpoly_clone_deep((LWPOLY *)lwgeom);
527  case COMPOUNDTYPE:
528  case CURVEPOLYTYPE:
529  case MULTICURVETYPE:
530  case MULTISURFACETYPE:
531  case MULTIPOINTTYPE:
532  case MULTILINETYPE:
533  case MULTIPOLYGONTYPE:
535  case TINTYPE:
536  case COLLECTIONTYPE:
537  return (LWGEOM *)lwcollection_clone_deep((LWCOLLECTION *)lwgeom);
538  default:
539  lwerror("lwgeom_clone_deep: Unknown geometry type: %s", lwtype_name(lwgeom->type));
540  return NULL;
541  }
542 }
#define LINETYPE
Definition: liblwgeom.h:85
LWPOLY * lwpoly_clone_deep(const LWPOLY *lwgeom)
Definition: lwpoly.c:226
#define MULTICURVETYPE
Definition: liblwgeom.h:94
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
#define TRIANGLETYPE
Definition: liblwgeom.h:97
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define TINTYPE
Definition: liblwgeom.h:98
LWCOLLECTION * lwcollection_clone_deep(const LWCOLLECTION *lwgeom)
Deep clone LWCOLLECTION object.
Definition: lwcollection.c:149
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:88
LWLINE * lwline_clone_deep(const LWLINE *lwgeom)
Definition: lwline.c:118
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:90

Here is the call graph for this function:

Here is the caller graph for this function: