PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_TriangulatePolygon()

Datum ST_TriangulatePolygon ( PG_FUNCTION_ARGS  )

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

3306 {
3307 #if POSTGIS_GEOS_VERSION < 31100
3308 
3309  lwpgerror("The GEOS version this PostGIS binary "
3310  "was compiled against (%d) doesn't support "
3311  "'GEOSConstrainedDelaunayTriangulation' function (3.11.0+ required)",
3313  PG_RETURN_NULL();
3314 
3315 #else /* POSTGIS_GEOS_VERSION >= 31100 */
3317  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
3318  LWGEOM *lwgeom_in = lwgeom_from_gserialized(geom);
3319  LWGEOM *lwgeom_out = lwgeom_triangulate_polygon(lwgeom_in);
3320  lwgeom_free(lwgeom_in);
3321 
3322  if (!lwgeom_out)
3323  {
3324  PG_FREE_IF_COPY(geom, 0);
3325  PG_RETURN_NULL();
3326  }
3327 
3328  result = geometry_serialize(lwgeom_out);
3329  lwgeom_free(lwgeom_out);
3330 
3331  PG_FREE_IF_COPY(geom, 0);
3332  PG_RETURN_POINTER(result);
3333 #endif
3334 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
LWGEOM * lwgeom_triangulate_polygon(const LWGEOM *geom)
Take vertices of a polygon and build a constrained triangulation that respects the boundary of the po...
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:11

References lwgeom_free(), lwgeom_from_gserialized(), lwgeom_triangulate_polygon(), POSTGIS_GEOS_VERSION, and result.

Here is the call graph for this function: