PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ST_TriangulatePolygon()

Datum ST_TriangulatePolygon ( PG_FUNCTION_ARGS  )

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

2268 {
2269 #if POSTGIS_GEOS_VERSION < 31100
2270 
2271  lwpgerror("The GEOS version this PostGIS binary "
2272  "was compiled against (%d) doesn't support "
2273  "'GEOSConstrainedDelaunayTriangulation' function (3.11.0+ required)",
2275  PG_RETURN_NULL();
2276 
2277 #else /* POSTGIS_GEOS_VERSION >= 31100 */
2279  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
2280  LWGEOM *lwgeom_in = lwgeom_from_gserialized(geom);
2281  LWGEOM *lwgeom_out = lwgeom_triangulate_polygon(lwgeom_in);
2282  lwgeom_free(lwgeom_in);
2283 
2284  if (!lwgeom_out)
2285  {
2286  PG_FREE_IF_COPY(geom, 0);
2287  PG_RETURN_NULL();
2288  }
2289 
2290  result = geometry_serialize(lwgeom_out);
2291  lwgeom_free(lwgeom_out);
2292 
2293  PG_FREE_IF_COPY(geom, 0);
2294  PG_RETURN_POINTER(result);
2295 #endif
2296 }
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
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1218
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: