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

Definition at line 1478 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().

1479 {
1480  switch (igeom->type)
1481  {
1482  case POINTTYPE:
1483  case MULTIPOINTTYPE:
1484  return lwgeom_clone(igeom);
1485  case LINETYPE:
1486  return (LWGEOM*)lwline_simplify((LWLINE*)igeom, dist);
1487  case POLYGONTYPE:
1488  return (LWGEOM*)lwpoly_simplify((LWPOLY*)igeom, dist);
1489  case MULTILINETYPE:
1490  case MULTIPOLYGONTYPE:
1491  case COLLECTIONTYPE:
1492  return (LWGEOM*)lwcollection_simplify((LWCOLLECTION *)igeom, dist);
1493  default:
1494  lwerror("lwgeom_simplify: unsupported geometry type: %s",lwtype_name(igeom->type));
1495  }
1496  return NULL;
1497 }
#define LINETYPE
Definition: liblwgeom.h:61
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
LWPOLY * lwpoly_simplify(const LWPOLY *ipoly, double dist)
Definition: lwpoly.c:346
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:351
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
LWLINE * lwline_simplify(const LWLINE *iline, double dist)
Definition: lwline.c:480
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
#define MULTILINETYPE
Definition: liblwgeom.h:64
LWCOLLECTION * lwcollection_simplify(const LWCOLLECTION *igeom, double dist)
Definition: lwcollection.c:496
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: