PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ST_DelaunayTriangles()

Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

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

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