PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_SimplifyPolygonHull()

Datum ST_SimplifyPolygonHull ( PG_FUNCTION_ARGS  )

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

970 {
971 #if POSTGIS_GEOS_VERSION < 31100
972 
973  lwpgerror("The GEOS version this PostGIS binary "
974  "was compiled against (%d) doesn't support "
975  "'ST_SimplifyPolygonHull' function (3.11.0+ required)",
977  PG_RETURN_NULL();
978 
979 #else /* POSTGIS_GEOS_VERSION >= 31100 */
980  GSERIALIZED* geom = PG_GETARG_GSERIALIZED_P(0);
981  double vertex_fraction = PG_GETARG_FLOAT8(1);
982  uint32_t is_outer = PG_GETARG_BOOL(2);
983 
984  LWGEOM* lwgeom = lwgeom_from_gserialized(geom);
985  LWGEOM* lwresult = lwgeom_simplify_polygonal(lwgeom, vertex_fraction, is_outer);
986  GSERIALIZED* result = geometry_serialize(lwresult);
987 
988  lwgeom_free(lwgeom);
989  lwgeom_free(lwresult);
990  PG_FREE_IF_COPY(geom, 0);
991  PG_RETURN_POINTER(result);
992 #endif
993 }
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_simplify_polygonal(const LWGEOM *geom, double vertex_fraction, uint32_t is_outer)
Computes a boundary-respecting hull of a polygonal geometry, with hull shape determined by a target p...
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:11

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

Here is the call graph for this function: