1125 TupleDesc resultTupleDesc;
1126 HeapTuple resultTuple;
1128 Datum result_values[2];
1129 bool result_is_null[2];
1132 if (PG_ARGISNULL(0))
1135 geom = PG_GETARG_GSERIALIZED_P(0);
1147 if (!(mbc && mbc->
center))
1149 lwpgerror(
"Error calculating minimum bounding circle.");
1164 get_call_result_type(fcinfo, NULL, &resultTupleDesc);
1165 BlessTupleDesc(resultTupleDesc);
1167 result_values[0] = PointerGetDatum(center);
1168 result_is_null[0] =
false;
1169 result_values[1] = Float8GetDatum(radius);
1170 result_is_null[1] =
false;
1172 resultTuple = heap_form_tuple(resultTupleDesc, result_values, result_is_null);
1174 result = HeapTupleGetDatum(resultTuple);
1176 PG_RETURN_DATUM(result);
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.
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
LWPOINT * lwpoint_make2d(int32_t srid, double x, double y)
void lwgeom_free(LWGEOM *geom)
LWBOUNDINGCIRCLE * lwgeom_calculate_mbc(const LWGEOM *g)
void lwboundingcircle_destroy(LWBOUNDINGCIRCLE *c)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)