PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ lwgeom_simplify()

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

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

1843 {
1844  LWGEOM *lwgeom_out = lwgeom_clone_deep(igeom);
1845  lwgeom_simplify_in_place(lwgeom_out, dist, preserve_collapsed);
1846  if (lwgeom_is_empty(lwgeom_out))
1847  {
1848  lwgeom_free(lwgeom_out);
1849  return NULL;
1850  }
1851  return lwgeom_out;
1852 }
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep-clone an LWGEOM object.
Definition: lwgeom.c:520
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1393
void lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed)
Definition: lwgeom.c:1748
void lwgeom_free(LWGEOM *lwgeom)
Definition: lwgeom.c:1144
Here is the call graph for this function:
Here is the caller graph for this function: