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

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

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

3244 {
3245  GSERIALIZED *result;
3246  GSERIALIZED *geom;
3247  LWGEOM *lwgeom_in, *lwgeom_out;
3248  double tolerance = 0.0;
3249  int flags = 0;
3250 
3251  geom = PG_GETARG_GSERIALIZED_P(0);
3252  tolerance = PG_GETARG_FLOAT8(1);
3253  flags = PG_GETARG_INT32(2);
3254 
3255  lwgeom_in = lwgeom_from_gserialized(geom);
3256  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3257  lwgeom_free(lwgeom_in) ;
3258 
3259  if ( ! lwgeom_out )
3260  {
3261  PG_FREE_IF_COPY(geom, 0);
3262  PG_RETURN_NULL();
3263  }
3264 
3265  result = geometry_serialize(lwgeom_out) ;
3266  lwgeom_free(lwgeom_out) ;
3267 
3268  PG_FREE_IF_COPY(geom, 0);
3269  PG_RETURN_POINTER(result);
3270 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
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: