PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ lwgeom_simplify()

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

Definition at line 1783 of file lwgeom.c.

References lwgeom_clone_deep(), lwgeom_free(), lwgeom_is_empty(), and lwgeom_simplify_in_place().

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

1784 {
1785  LWGEOM *lwgeom_out = lwgeom_clone_deep(igeom);
1786  lwgeom_simplify_in_place(lwgeom_out, dist, preserve_collapsed);
1787  if (lwgeom_is_empty(lwgeom_out))
1788  {
1789  lwgeom_free(lwgeom_out);
1790  return NULL;
1791  }
1792  return lwgeom_out;
1793 }
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwinline.h:172
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep-clone an LWGEOM object.
Definition: lwgeom.c:511
void lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed)
Definition: lwgeom.c:1689
void lwgeom_free(LWGEOM *lwgeom)
Definition: lwgeom.c:1128
Here is the call graph for this function:
Here is the caller graph for this function: