PostGIS  3.6.1dev-r@@SVN_REVISION@@

◆ ST_DelaunayTriangles()

Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

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

2234 {
2236  GSERIALIZED *geom;
2237  LWGEOM *lwgeom_in, *lwgeom_out;
2238  double tolerance = 0.0;
2239  int flags = 0;
2240 
2241  geom = PG_GETARG_GSERIALIZED_P(0);
2242  tolerance = PG_GETARG_FLOAT8(1);
2243  flags = PG_GETARG_INT32(2);
2244 
2245  lwgeom_in = lwgeom_from_gserialized(geom);
2246  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
2247  lwgeom_free(lwgeom_in) ;
2248 
2249  if ( ! lwgeom_out )
2250  {
2251  PG_FREE_IF_COPY(geom, 0);
2252  PG_RETURN_NULL();
2253  }
2254 
2255  result = geometry_serialize(lwgeom_out) ;
2256  lwgeom_free(lwgeom_out) ;
2257 
2258  PG_FREE_IF_COPY(geom, 0);
2259  PG_RETURN_POINTER(result);
2260 }
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:268
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:1218

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

Here is the call graph for this function: