PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_DelaunayTriangles()

Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

Definition at line 3392 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().

3393 {
3394  GSERIALIZED *result;
3395  GSERIALIZED *geom;
3396  LWGEOM *lwgeom_in, *lwgeom_out;
3397  double tolerance = 0.0;
3398  int flags = 0;
3399 
3400  geom = PG_GETARG_GSERIALIZED_P(0);
3401  tolerance = PG_GETARG_FLOAT8(1);
3402  flags = PG_GETARG_INT32(2);
3403 
3404  lwgeom_in = lwgeom_from_gserialized(geom);
3405  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3406  lwgeom_free(lwgeom_in) ;
3407 
3408  if ( ! lwgeom_out )
3409  {
3410  PG_FREE_IF_COPY(geom, 0);
3411  PG_RETURN_NULL();
3412  }
3413 
3414  result = geometry_serialize(lwgeom_out) ;
3415  lwgeom_free(lwgeom_out) ;
3416 
3417  PG_FREE_IF_COPY(geom, 0);
3418  PG_RETURN_POINTER(result);
3419 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
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: