PostGIS  2.3.7dev-r@@SVN_REVISION@@
LWGEOM* lwgeom_simplify ( const LWGEOM igeom,
double  dist,
int  preserve_collapsed 
)

Definition at line 1571 of file lwgeom.c.

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

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

1572 {
1573  switch (igeom->type)
1574  {
1575  case POINTTYPE:
1576  case MULTIPOINTTYPE:
1577  return lwgeom_clone(igeom);
1578  case LINETYPE:
1579  return (LWGEOM*)lwline_simplify((LWLINE*)igeom, dist, preserve_collapsed);
1580  case POLYGONTYPE:
1581  return (LWGEOM*)lwpoly_simplify((LWPOLY*)igeom, dist, preserve_collapsed);
1582  case MULTILINETYPE:
1583  case MULTIPOLYGONTYPE:
1584  case COLLECTIONTYPE:
1585  return (LWGEOM*)lwcollection_simplify((LWCOLLECTION *)igeom, dist, preserve_collapsed);
1586  default:
1587  lwerror("%s: unsupported geometry type: %s", __func__, lwtype_name(igeom->type));
1588  }
1589  return NULL;
1590 }
#define LINETYPE
Definition: liblwgeom.h:85
LWPOLY * lwpoly_simplify(const LWPOLY *ipoly, double dist, int preserve_collapsed)
Definition: lwpoly.c:422
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
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:216
LWCOLLECTION * lwcollection_simplify(const LWCOLLECTION *igeom, double dist, int preserve_collapsed)
Definition: lwcollection.c:519
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:408
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#define MULTILINETYPE
Definition: liblwgeom.h:88
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:102
#define COLLECTIONTYPE
Definition: liblwgeom.h:90

Here is the call graph for this function:

Here is the caller graph for this function: