PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_DelaunayTriangles()

Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

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

3271 {
3273  GSERIALIZED *geom;
3274  LWGEOM *lwgeom_in, *lwgeom_out;
3275  double tolerance = 0.0;
3276  int flags = 0;
3277 
3278  geom = PG_GETARG_GSERIALIZED_P(0);
3279  tolerance = PG_GETARG_FLOAT8(1);
3280  flags = PG_GETARG_INT32(2);
3281 
3282  lwgeom_in = lwgeom_from_gserialized(geom);
3283  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3284  lwgeom_free(lwgeom_in) ;
3285 
3286  if ( ! lwgeom_out )
3287  {
3288  PG_FREE_IF_COPY(geom, 0);
3289  PG_RETURN_NULL();
3290  }
3291 
3292  result = geometry_serialize(lwgeom_out) ;
3293  lwgeom_free(lwgeom_out) ;
3294 
3295  PG_FREE_IF_COPY(geom, 0);
3296  PG_RETURN_POINTER(result);
3297 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
LWGEOM * lwgeom_delaunay_triangulation(const LWGEOM *geom, double tolerance, int32_t edgeOnly)
Take vertices of a geometry and build a delaunay triangulation on them.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155

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

Here is the call graph for this function: