PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_chaikin()

LWGEOM* lwgeom_chaikin ( const LWGEOM igeom,
int  n_iterations,
int  preserve_endpoint 
)

Definition at line 182 of file lwchaikins.c.

183 {
184  LWDEBUG(2, "Entered lwgeom_set_effective_area");
185  switch (igeom->type)
186  {
187  case POINTTYPE:
188  case MULTIPOINTTYPE:
189  return lwgeom_clone(igeom);
190  case LINETYPE:
191  return (LWGEOM*)lwline_chaikin((LWLINE*)igeom, n_iterations);
192  case POLYGONTYPE:
193  return (LWGEOM*)lwpoly_chaikin((LWPOLY*)igeom,n_iterations,preserve_endpoint);
194  case MULTILINETYPE:
195  case MULTIPOLYGONTYPE:
196  case COLLECTIONTYPE:
197  return (LWGEOM*)lwcollection_chaikin((LWCOLLECTION *)igeom,n_iterations,preserve_endpoint);
198  default:
199  lwerror("lwgeom_chaikin: unsupported geometry type: %s",lwtype_name(igeom->type));
200  }
201  return NULL;
202 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:482
static LWLINE * lwline_chaikin(const LWLINE *iline, int n_iterations)
Definition: lwchaikins.c:101
static LWPOLY * lwpoly_chaikin(const LWPOLY *ipoly, int n_iterations, int preserve_endpoint)
Definition: lwchaikins.c:126
static LWCOLLECTION * lwcollection_chaikin(const LWCOLLECTION *igeom, int n_iterations, int preserve_endpoint)
Definition: lwchaikins.c:162
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
uint8_t type
Definition: liblwgeom.h:399

References COLLECTIONTYPE, LINETYPE, lwcollection_chaikin(), LWDEBUG, lwerror(), lwgeom_clone(), lwline_chaikin(), lwpoly_chaikin(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, LWGEOM::type, and LWLINE::type.

Referenced by do_test_chaikin(), lwcollection_chaikin(), and LWGEOM_ChaikinSmoothing().

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