PostGIS  2.5.0dev-r@@SVN_REVISION@@
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 681 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, and LWGEOM::type.

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

684 {
685  LWGEOM * ogeom = NULL;
686  switch (geom->type)
687  {
688  case CIRCSTRINGTYPE:
689  ogeom = (LWGEOM *)lwcircstring_linearize((LWCIRCSTRING *)geom, tol, type, flags);
690  break;
691  case COMPOUNDTYPE:
692  ogeom = (LWGEOM *)lwcompound_linearize((LWCOMPOUND *)geom, tol, type, flags);
693  break;
694  case CURVEPOLYTYPE:
695  ogeom = (LWGEOM *)lwcurvepoly_linearize((LWCURVEPOLY *)geom, tol, type, flags);
696  break;
697  case MULTICURVETYPE:
698  ogeom = (LWGEOM *)lwmcurve_linearize((LWMCURVE *)geom, tol, type, flags);
699  break;
700  case MULTISURFACETYPE:
701  ogeom = (LWGEOM *)lwmsurface_linearize((LWMSURFACE *)geom, tol, type, flags);
702  break;
703  case COLLECTIONTYPE:
704  ogeom = (LWGEOM *)lwcollection_linearize((LWCOLLECTION *)geom, tol, type, flags);
705  break;
706  default:
707  ogeom = lwgeom_clone(geom);
708  }
709  return ogeom;
710 }
static LWMLINE * lwmcurve_linearize(const LWMCURVE *mcurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:546
#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:419
static LWPOLY * lwcurvepoly_linearize(const LWCURVEPOLY *curvepoly, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:484
static LWMPOLY * lwmsurface_linearize(const LWMSURFACE *msurface, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:593
static LWLINE * lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:359
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:475
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
uint8_t type
Definition: liblwgeom.h:395
static LWCOLLECTION * lwcollection_linearize(const LWCOLLECTION *collection, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:639
#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: