PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_simplify()

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

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

1559 {
1560  switch (igeom->type)
1561  {
1562  case POINTTYPE:
1563  case MULTIPOINTTYPE:
1564  return lwgeom_clone(igeom);
1565  case LINETYPE:
1566  return (LWGEOM*)lwline_simplify((LWLINE*)igeom, dist, preserve_collapsed);
1567  case POLYGONTYPE:
1568  return (LWGEOM*)lwpoly_simplify((LWPOLY*)igeom, dist, preserve_collapsed);
1569  case MULTILINETYPE:
1570  case MULTIPOLYGONTYPE:
1571  case COLLECTIONTYPE:
1572  return (LWGEOM*)lwcollection_simplify((LWCOLLECTION *)igeom, dist, preserve_collapsed);
1573  default:
1574  lwerror("%s: unsupported geometry type: %s", __func__, lwtype_name(igeom->type));
1575  }
1576  return NULL;
1577 }
#define LINETYPE
Definition: liblwgeom.h:71
LWPOLY * lwpoly_simplify(const LWPOLY *ipoly, double dist, int preserve_collapsed)
Definition: lwpoly.c:351
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
LWCOLLECTION * lwcollection_simplify(const LWCOLLECTION *igeom, double dist, int preserve_collapsed)
Definition: lwcollection.c:506
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:395
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
#define MULTILINETYPE
Definition: liblwgeom.h:74
LWLINE * lwline_simplify(const LWLINE *iline, double dist, int preserve_collapsed)
Definition: lwline.c:512
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76
Here is the call graph for this function:
Here is the caller graph for this function: