PostGIS  2.4.9dev-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 734 of file lwstroke.c.

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

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

737 {
738  LWGEOM * ogeom = NULL;
739  switch (geom->type)
740  {
741  case CIRCSTRINGTYPE:
742  ogeom = (LWGEOM *)lwcircstring_linearize((LWCIRCSTRING *)geom, tol, type, flags);
743  break;
744  case COMPOUNDTYPE:
745  ogeom = (LWGEOM *)lwcompound_linearize((LWCOMPOUND *)geom, tol, type, flags);
746  break;
747  case CURVEPOLYTYPE:
748  ogeom = (LWGEOM *)lwcurvepoly_linearize((LWCURVEPOLY *)geom, tol, type, flags);
749  break;
750  case MULTICURVETYPE:
751  ogeom = (LWGEOM *)lwmcurve_linearize((LWMCURVE *)geom, tol, type, flags);
752  break;
753  case MULTISURFACETYPE:
754  ogeom = (LWGEOM *)lwmsurface_linearize((LWMSURFACE *)geom, tol, type, flags);
755  break;
756  case COLLECTIONTYPE:
757  ogeom = (LWGEOM *)lwcollection_linearize((LWCOLLECTION *)geom, tol, type, flags);
758  break;
759  default:
760  ogeom = lwgeom_clone(geom);
761  }
762  return ogeom;
763 }
static LWMLINE * lwmcurve_linearize(const LWMCURVE *mcurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:599
#define MULTICURVETYPE
Definition: liblwgeom.h:95
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
static LWLINE * lwcompound_linearize(const LWCOMPOUND *icompound, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:472
static LWPOLY * lwcurvepoly_linearize(const LWCURVEPOLY *curvepoly, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:537
static LWMPOLY * lwmsurface_linearize(const LWMSURFACE *msurface, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:646
static LWLINE * lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:412
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:444
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
uint8_t type
Definition: liblwgeom.h:396
type
Definition: ovdump.py:41
static LWCOLLECTION * lwcollection_linearize(const LWCOLLECTION *collection, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:692
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function:
Here is the caller graph for this function: