731{
737 int segs_per_quarter;
738
739 if (PG_ARGISNULL(0))
740 PG_RETURN_NULL();
741
742 geom = PG_GETARG_GSERIALIZED_P(0);
743 segs_per_quarter = PG_GETARG_INT32(1);
744
745
747 {
749 }
750 else
751 {
754
755 if (!(mbc && mbc->
center))
756 {
757 lwpgerror("Error calculating minimum bounding circle.");
759 PG_RETURN_NULL();
760 }
761
762
765 else
767
770 }
771
772 center = geometry_serialize(lwcircle);
774
775 PG_RETURN_POINTER(center);
776}
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
LWPOLY * lwpoly_construct_circle(int32_t srid, double x, double y, double radius, uint32_t segments_per_quarter, char exterior)
void lwgeom_free(LWGEOM *geom)
LWBOUNDINGCIRCLE * lwgeom_calculate_mbc(const LWGEOM *g)
LWPOINT * lwpoint_make2d(int32_t srid, double x, double y)
void lwboundingcircle_destroy(LWBOUNDINGCIRCLE *c)
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
#define LW_TRUE
Return types for functions with status returns.
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)