PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_simplify()

LWGEOM* lwgeom_simplify ( const LWGEOM igeom,
double  dist,
int  preserve_collapsed 
)

Definition at line 1602 of file lwgeom.c.

References COLLECTIONTYPE, LINETYPE, lwcollection_simplify(), lwerror(), lwgeom_clone(), lwline_simplify(), lwpoly_simplify(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, LWGEOM::type, and LWCOLLECTION::type.

Referenced by lwcollection_simplify(), LWGEOM_simplify2d(), test_lwgeom_simplify(), and test_misc_simplify().

1603 {
1604  switch (igeom->type)
1605  {
1606  case POINTTYPE:
1607  case MULTIPOINTTYPE:
1608  return lwgeom_clone(igeom);
1609  case LINETYPE:
1610  return (LWGEOM*)lwline_simplify((LWLINE*)igeom, dist, preserve_collapsed);
1611  case POLYGONTYPE:
1612  return (LWGEOM*)lwpoly_simplify((LWPOLY*)igeom, dist, preserve_collapsed);
1613  case MULTILINETYPE:
1614  case MULTIPOLYGONTYPE:
1615  case COLLECTIONTYPE:
1616  return (LWGEOM*)lwcollection_simplify((LWCOLLECTION *)igeom, dist, preserve_collapsed);
1617  default:
1618  lwerror("%s: unsupported geometry type: %s", __func__, lwtype_name(igeom->type));
1619  }
1620  return NULL;
1621 }
#define LINETYPE
Definition: liblwgeom.h:86
LWPOLY * lwpoly_simplify(const LWPOLY *ipoly, double dist, int preserve_collapsed)
Definition: lwpoly.c:464
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
LWCOLLECTION * lwcollection_simplify(const LWCOLLECTION *igeom, double dist, int preserve_collapsed)
Definition: lwcollection.c:526
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:444
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
uint8_t type
Definition: liblwgeom.h:396
#define MULTILINETYPE
Definition: liblwgeom.h:89
LWLINE * lwline_simplify(const LWLINE *iline, double dist, int preserve_collapsed)
Definition: lwline.c:541
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function:
Here is the caller graph for this function: