PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ ST_DelaunayTriangles()

Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

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

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

Referenced by ST_BuildArea().

3322 {
3323  GSERIALIZED *result;
3324  GSERIALIZED *geom;
3325  LWGEOM *lwgeom_in, *lwgeom_out;
3326  double tolerance = 0.0;
3327  int flags = 0;
3328 
3329  geom = PG_GETARG_GSERIALIZED_P(0);
3330  tolerance = PG_GETARG_FLOAT8(1);
3331  flags = PG_GETARG_INT32(2);
3332 
3333  lwgeom_in = lwgeom_from_gserialized(geom);
3334  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3335  lwgeom_free(lwgeom_in) ;
3336 
3337  if ( ! lwgeom_out )
3338  {
3339  PG_FREE_IF_COPY(geom, 0);
3340  PG_RETURN_NULL();
3341  }
3342 
3343  result = geometry_serialize(lwgeom_out) ;
3344  lwgeom_free(lwgeom_out) ;
3345 
3346  PG_FREE_IF_COPY(geom, 0);
3347  PG_RETURN_POINTER(result);
3348 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
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:
Here is the caller graph for this function: