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

◆ ST_SimplifyPolygonHull()

Datum ST_SimplifyPolygonHull ( PG_FUNCTION_ARGS  )

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

908{
909#if POSTGIS_GEOS_VERSION < 31100
910
911 lwpgerror("The GEOS version this PostGIS binary "
912 "was compiled against (%d) doesn't support "
913 "'ST_SimplifyPolygonHull' function (3.11.0+ required)",
915 PG_RETURN_NULL();
916
917#else /* POSTGIS_GEOS_VERSION >= 31100 */
918 GSERIALIZED* geom = PG_GETARG_GSERIALIZED_P(0);
919 double vertex_fraction = PG_GETARG_FLOAT8(1);
920 uint32_t is_outer = PG_GETARG_BOOL(2);
921
922 LWGEOM* lwgeom = lwgeom_from_gserialized(geom);
923 LWGEOM* lwresult = lwgeom_simplify_polygonal(lwgeom, vertex_fraction, is_outer);
924 GSERIALIZED* result = geometry_serialize(lwresult);
925
926 lwgeom_free(lwgeom);
927 lwgeom_free(lwresult);
928 PG_FREE_IF_COPY(geom, 0);
929 PG_RETURN_POINTER(result);
930#endif
931}
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_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: