PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcurve_linearize()

LWGEOM* lwcurve_linearize ( const LWGEOM geom,
double  tol,
LW_LINEARIZE_TOLERANCE_TYPE  type,
int  flags 
)
Parameters
geominput geometry
toltolerance, semantic driven by tolerance_type
tolerance_typesee LW_LINEARIZE_TOLERANCE_TYPE
flagsbitwise OR of operational flags, see LW_LINEARIZE_FLAGS
Returns
a newly allocated LWGEOM

Definition at line 735 of file lwstroke.c.

738 {
739  LWGEOM * ogeom = NULL;
740  switch (geom->type)
741  {
742  case CIRCSTRINGTYPE:
743  ogeom = (LWGEOM *)lwcircstring_linearize((LWCIRCSTRING *)geom, tol, type, flags);
744  break;
745  case COMPOUNDTYPE:
746  ogeom = (LWGEOM *)lwcompound_linearize((LWCOMPOUND *)geom, tol, type, flags);
747  break;
748  case CURVEPOLYTYPE:
749  ogeom = (LWGEOM *)lwcurvepoly_linearize((LWCURVEPOLY *)geom, tol, type, flags);
750  break;
751  case MULTICURVETYPE:
752  ogeom = (LWGEOM *)lwmcurve_linearize((LWMCURVE *)geom, tol, type, flags);
753  break;
754  case MULTISURFACETYPE:
755  ogeom = (LWGEOM *)lwmsurface_linearize((LWMSURFACE *)geom, tol, type, flags);
756  break;
757  case COLLECTIONTYPE:
758  ogeom = (LWGEOM *)lwcollection_linearize((LWCOLLECTION *)geom, tol, type, flags);
759  break;
760  default:
761  ogeom = lwgeom_clone_deep(geom);
762  }
763  return ogeom;
764 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
Definition: lwgeom.c:520
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
#define MULTICURVETYPE
Definition: liblwgeom.h:95
static LWLINE * lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:413
static LWMPOLY * lwmsurface_linearize(const LWMSURFACE *msurface, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:647
static LWLINE * lwcompound_linearize(const LWCOMPOUND *icompound, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:473
static LWCOLLECTION * lwcollection_linearize(const LWCOLLECTION *collection, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:693
static LWMLINE * lwmcurve_linearize(const LWMCURVE *mcurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:600
static LWPOLY * lwcurvepoly_linearize(const LWCURVEPOLY *curvepoly, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:538
type
Definition: ovdump.py:41
uint8_t type
Definition: liblwgeom.h:399

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, lwcircstring_linearize(), lwcollection_linearize(), lwcompound_linearize(), lwcurvepoly_linearize(), lwgeom_clone_deep(), lwmcurve_linearize(), lwmsurface_linearize(), MULTICURVETYPE, MULTISURFACETYPE, LWGEOM::type, and ovdump::type.

Referenced by lwgeom_stroke(), ST_CurveToLine(), and test_lwcurve_linearize().

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