PostGIS  2.5.0dev-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 682 of file lwstroke.c.

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

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

685 {
686  LWGEOM * ogeom = NULL;
687  switch (geom->type)
688  {
689  case CIRCSTRINGTYPE:
690  ogeom = (LWGEOM *)lwcircstring_linearize((LWCIRCSTRING *)geom, tol, type, flags);
691  break;
692  case COMPOUNDTYPE:
693  ogeom = (LWGEOM *)lwcompound_linearize((LWCOMPOUND *)geom, tol, type, flags);
694  break;
695  case CURVEPOLYTYPE:
696  ogeom = (LWGEOM *)lwcurvepoly_linearize((LWCURVEPOLY *)geom, tol, type, flags);
697  break;
698  case MULTICURVETYPE:
699  ogeom = (LWGEOM *)lwmcurve_linearize((LWMCURVE *)geom, tol, type, flags);
700  break;
701  case MULTISURFACETYPE:
702  ogeom = (LWGEOM *)lwmsurface_linearize((LWMSURFACE *)geom, tol, type, flags);
703  break;
704  case COLLECTIONTYPE:
705  ogeom = (LWGEOM *)lwcollection_linearize((LWCOLLECTION *)geom, tol, type, flags);
706  break;
707  default:
708  ogeom = lwgeom_clone_deep(geom);
709  }
710  return ogeom;
711 }
static LWMLINE * lwmcurve_linearize(const LWMCURVE *mcurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:547
#define MULTICURVETYPE
Definition: liblwgeom.h:94
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
static LWLINE * lwcompound_linearize(const LWCOMPOUND *icompound, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:420
static LWPOLY * lwcurvepoly_linearize(const LWCURVEPOLY *curvepoly, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:485
static LWMPOLY * lwmsurface_linearize(const LWMSURFACE *msurface, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:594
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
Definition: lwgeom.c:520
static LWLINE * lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:360
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
uint8_t type
Definition: liblwgeom.h:398
type
Definition: ovdump.py:41
static LWCOLLECTION * lwcollection_linearize(const LWCOLLECTION *collection, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:640
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: