PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_ConcaveHull()

Datum ST_ConcaveHull ( PG_FUNCTION_ARGS  )

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

942 {
943 #if POSTGIS_GEOS_VERSION < 31100
944 
945  lwpgerror("The GEOS version this PostGIS binary "
946  "was compiled against (%d) doesn't support "
947  "'GEOSConcaveHull' function (3.11.0+ required)",
949  PG_RETURN_NULL();
950 
951 #else /* POSTGIS_GEOS_VERSION >= 31100 */
952  GSERIALIZED* geom = PG_GETARG_GSERIALIZED_P(0);
953  double ratio = PG_GETARG_FLOAT8(1);
954  bool allow_holes = PG_GETARG_BOOL(2);
955 
956  LWGEOM* lwgeom = lwgeom_from_gserialized(geom);
957  LWGEOM* lwresult = lwgeom_concavehull(lwgeom, ratio, allow_holes);
958  GSERIALIZED* result = geometry_serialize(lwresult);
959 
960  lwgeom_free(lwgeom);
961  lwgeom_free(lwresult);
962  PG_FREE_IF_COPY(geom, 0);
963  PG_RETURN_POINTER(result);
964 #endif
965 }
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_concavehull(const LWGEOM *geom, double ratio, uint32_t allow_holes)
Take a geometry and build the concave hull.
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:11

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

Here is the call graph for this function: