PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ ST_TriangulatePolygon()

Datum ST_TriangulatePolygon ( PG_FUNCTION_ARGS  )

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

3196 {
3197 #if POSTGIS_GEOS_VERSION < 31100
3198 
3199  lwpgerror("The GEOS version this PostGIS binary "
3200  "was compiled against (%d) doesn't support "
3201  "'GEOSConstrainedDelaunayTriangulation' function (3.11.0+ required)",
3203  PG_RETURN_NULL();
3204 
3205 #else /* POSTGIS_GEOS_VERSION >= 31100 */
3207  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
3208  LWGEOM *lwgeom_in = lwgeom_from_gserialized(geom);
3209  LWGEOM *lwgeom_out = lwgeom_triangulate_polygon(lwgeom_in);
3210  lwgeom_free(lwgeom_in);
3211 
3212  if (!lwgeom_out)
3213  {
3214  PG_FREE_IF_COPY(geom, 0);
3215  PG_RETURN_NULL();
3216  }
3217 
3218  result = geometry_serialize(lwgeom_out);
3219  lwgeom_free(lwgeom_out);
3220 
3221  PG_FREE_IF_COPY(geom, 0);
3222  PG_RETURN_POINTER(result);
3223 #endif
3224 }
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:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:11

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

Here is the call graph for this function: