PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

Definition at line 3625 of file postgis/lwgeom_geos.c.

References dumpnode::geom, geometry_serialize(), lwgeom_delaunay_triangulation(), lwgeom_free(), and lwgeom_from_gserialized().

3626 {
3627  GSERIALIZED *result;
3628  GSERIALIZED *geom;
3629  LWGEOM *lwgeom_in, *lwgeom_out;
3630  double tolerance = 0.0;
3631  int flags = 0;
3632 
3633  geom = PG_GETARG_GSERIALIZED_P(0);
3634  tolerance = PG_GETARG_FLOAT8(1);
3635  flags = PG_GETARG_INT32(2);
3636 
3637  lwgeom_in = lwgeom_from_gserialized(geom);
3638  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3639  lwgeom_free(lwgeom_in) ;
3640 
3641  if ( ! lwgeom_out )
3642  {
3643  PG_FREE_IF_COPY(geom, 0);
3644  PG_RETURN_NULL();
3645  }
3646 
3647  result = geometry_serialize(lwgeom_out) ;
3648  lwgeom_free(lwgeom_out) ;
3649 
3650  PG_FREE_IF_COPY(geom, 0);
3651  PG_RETURN_POINTER(result);
3652 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * geom
LWGEOM * lwgeom_delaunay_triangulation(const LWGEOM *geom, double tolerance, int edgeOnly)
Take vertices of a geometry and build a delaunay triangulation on them.
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: