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

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

References geometry_serialize(), lwgeom_delaunay_triangulation(), lwgeom_free(), lwgeom_from_gserialized(), and result.

3428 {
3430  GSERIALIZED *geom;
3431  LWGEOM *lwgeom_in, *lwgeom_out;
3432  double tolerance = 0.0;
3433  int flags = 0;
3434 
3435  geom = (GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
3436  tolerance = PG_GETARG_FLOAT8(1);
3437  flags = PG_GETARG_INT32(2);
3438 
3439  lwgeom_in = lwgeom_from_gserialized(geom);
3440  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3441  lwgeom_free(lwgeom_in) ;
3442 
3443  if ( ! lwgeom_out ) {
3444  PG_FREE_IF_COPY(geom, 0);
3445  PG_RETURN_NULL();
3446  }
3447 
3448  result = geometry_serialize(lwgeom_out) ;
3449  lwgeom_free(lwgeom_out) ;
3450 
3451  PG_FREE_IF_COPY(geom, 0);
3452  PG_RETURN_POINTER(result);
3453 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
char ** result
Definition: liblwgeom.h:218
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: