PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ ST_SimplifyPolygonHull()

Datum ST_SimplifyPolygonHull ( PG_FUNCTION_ARGS  )

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

853 {
854 #if POSTGIS_GEOS_VERSION < 31100
855 
856  lwpgerror("The GEOS version this PostGIS binary "
857  "was compiled against (%d) doesn't support "
858  "'ST_SimplifyPolygonHull' function (3.11.0+ required)",
860  PG_RETURN_NULL();
861 
862 #else /* POSTGIS_GEOS_VERSION >= 31100 */
863  GSERIALIZED* geom = PG_GETARG_GSERIALIZED_P(0);
864  double vertex_fraction = PG_GETARG_FLOAT8(1);
865  uint32_t is_outer = PG_GETARG_BOOL(2);
866 
867  LWGEOM* lwgeom = lwgeom_from_gserialized(geom);
868  LWGEOM* lwresult = lwgeom_simplify_polygonal(lwgeom, vertex_fraction, is_outer);
869  GSERIALIZED* result = geometry_serialize(lwresult);
870 
871  lwgeom_free(lwgeom);
872  lwgeom_free(lwresult);
873  PG_FREE_IF_COPY(geom, 0);
874  PG_RETURN_POINTER(result);
875 #endif
876 }
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: