PostGIS  3.0.6dev-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 826 of file lwstroke.c.

829 {
830  LWGEOM * ogeom = NULL;
831  switch (geom->type)
832  {
833  case CIRCSTRINGTYPE:
834  ogeom = (LWGEOM *)lwcircstring_linearize((LWCIRCSTRING *)geom, tol, type, flags);
835  break;
836  case COMPOUNDTYPE:
837  ogeom = (LWGEOM *)lwcompound_linearize((LWCOMPOUND *)geom, tol, type, flags);
838  break;
839  case CURVEPOLYTYPE:
840  ogeom = (LWGEOM *)lwcurvepoly_linearize((LWCURVEPOLY *)geom, tol, type, flags);
841  break;
842  case MULTICURVETYPE:
843  ogeom = (LWGEOM *)lwmcurve_linearize((LWMCURVE *)geom, tol, type, flags);
844  break;
845  case MULTISURFACETYPE:
846  ogeom = (LWGEOM *)lwmsurface_linearize((LWMSURFACE *)geom, tol, type, flags);
847  break;
848  case COLLECTIONTYPE:
849  ogeom = (LWGEOM *)lwcollection_linearize((LWCOLLECTION *)geom, tol, type, flags);
850  break;
851  default:
852  ogeom = lwgeom_clone_deep(geom);
853  }
854  return ogeom;
855 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:122
#define COMPOUNDTYPE
Definition: liblwgeom.h:124
#define CURVEPOLYTYPE
Definition: liblwgeom.h:125
#define MULTISURFACETYPE
Definition: liblwgeom.h:127
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
Definition: lwgeom.c:511
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:123
#define MULTICURVETYPE
Definition: liblwgeom.h:126
static LWLINE * lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:512
static LWMPOLY * lwmsurface_linearize(const LWMSURFACE *msurface, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:738
static LWLINE * lwcompound_linearize(const LWCOMPOUND *icompound, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:572
static LWCOLLECTION * lwcollection_linearize(const LWCOLLECTION *collection, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:784
static LWMLINE * lwmcurve_linearize(const LWMCURVE *mcurve, double tol, LW_LINEARIZE_TOLERANCE_TYPE type, int flags)
Definition: lwstroke.c:691
static LWPOLY * lwcurvepoly_linearize(const LWCURVEPOLY *curvepoly, double tol, LW_LINEARIZE_TOLERANCE_TYPE tolerance_type, int flags)
Definition: lwstroke.c:629
type
Definition: ovdump.py:42
uint8_t type
Definition: liblwgeom.h:448

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: