PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ ST_DelaunayTriangles()

Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

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

3254 {
3256  GSERIALIZED *geom;
3257  LWGEOM *lwgeom_in, *lwgeom_out;
3258  double tolerance = 0.0;
3259  int flags = 0;
3260 
3261  geom = PG_GETARG_GSERIALIZED_P(0);
3262  tolerance = PG_GETARG_FLOAT8(1);
3263  flags = PG_GETARG_INT32(2);
3264 
3265  lwgeom_in = lwgeom_from_gserialized(geom);
3266  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3267  lwgeom_free(lwgeom_in) ;
3268 
3269  if ( ! lwgeom_out )
3270  {
3271  PG_FREE_IF_COPY(geom, 0);
3272  PG_RETURN_NULL();
3273  }
3274 
3275  result = geometry_serialize(lwgeom_out) ;
3276  lwgeom_free(lwgeom_out) ;
3277 
3278  PG_FREE_IF_COPY(geom, 0);
3279  PG_RETURN_POINTER(result);
3280 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
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:1138

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

Here is the call graph for this function: