731 GEOSGeometry *g1, *g3;
737 geom1 = PG_GETARG_GSERIALIZED_P(0);
741 PG_RETURN_POINTER(geom1);
755 g3 = (GEOSGeometry *)GEOSConvexHull(g1);
756 GEOSGeom_destroy(g1);
764 POSTGIS_DEBUGF(3,
"result: %s", GEOSGeomToWKT(g3));
766 GEOSSetSRID(g3, srid);
769 GEOSGeom_destroy(g3);
773 elog(ERROR,
"convexhull() failed to convert GEOS geometry to LWGEOM");
790 elog(ERROR,
"GEOS convexhull() threw an error (result postgis geometry formation)!");
794 PG_FREE_IF_COPY(geom1, 0);
795 PG_RETURN_POINTER(result);
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box)
Read the bounding box off a serialization and calculate one if it is not already there.
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
void lwgeom_free(LWGEOM *geom)
int gserialized_has_z(const GSERIALIZED *gser)
Check if a GSERIALIZED has a Z ordinate.
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
void lwgeom_geos_error(const char *fmt,...)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
#define HANDLE_GEOS_ERROR(label)
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...