PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ST_TriangulatePolygon()

Datum ST_TriangulatePolygon ( PG_FUNCTION_ARGS  )

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

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