PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ ST_TriangulatePolygon()

Datum ST_TriangulatePolygon ( PG_FUNCTION_ARGS  )

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

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