PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ ST_DelaunayTriangles()

Datum ST_DelaunayTriangles ( PG_FUNCTION_ARGS  )

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

3093 {
3094  GSERIALIZED *result;
3095  GSERIALIZED *geom;
3096  LWGEOM *lwgeom_in, *lwgeom_out;
3097  double tolerance = 0.0;
3098  int flags = 0;
3099 
3100  geom = PG_GETARG_GSERIALIZED_P(0);
3101  tolerance = PG_GETARG_FLOAT8(1);
3102  flags = PG_GETARG_INT32(2);
3103 
3104  lwgeom_in = lwgeom_from_gserialized(geom);
3105  lwgeom_out = lwgeom_delaunay_triangulation(lwgeom_in, tolerance, flags);
3106  lwgeom_free(lwgeom_in) ;
3107 
3108  if ( ! lwgeom_out )
3109  {
3110  PG_FREE_IF_COPY(geom, 0);
3111  PG_RETURN_NULL();
3112  }
3113 
3114  result = geometry_serialize(lwgeom_out) ;
3115  lwgeom_free(lwgeom_out) ;
3116 
3117  PG_FREE_IF_COPY(geom, 0);
3118  PG_RETURN_POINTER(result);
3119 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_delaunay_triangulation(const LWGEOM *geom, double tolerance, int32_t edgeOnly)
Take vertices of a geometry and build a delaunay triangulation on them.
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: