Peak into a GSERIALIZED datum to find its bounding box and some other metadata.
If the box is there, copy it out and return it. If not, calculate the box from the full object and return the box based on that. If no box is available, return LW_FAILURE, otherwise LW_SUCCESS.
Definition at line 475 of file gserialized_gist_2d.c.
479 int need_detoast = PG_GSERIALIZED_DATUM_NEEDS_DETOAST((
struct varlena *)gsdatum);
char result[OUT_DOUBLE_BUFFER_SIZE]
int gserialized_has_bbox(const GSERIALIZED *g)
Check if a GSERIALIZED has a bounding box without deserializing first.
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)...
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *gbox)
Read the box from the GSERIALIZED or calculate it if necessary.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
uint32_t gserialized_max_header_size(void)
Returns the size in bytes to read from toast to get the basic information from a geometry: GSERIALIZE...
lwflags_t gserialized_get_lwflags(const GSERIALIZED *g)
Read the flags from a GSERIALIZED and return a standard lwflag integer.
#define LWSIZE_GET(varsize)
Macro for reading the size from the GSERIALIZED size attribute.
#define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori)
References gserialized_get_gbox_p(), gserialized_get_lwflags(), gserialized_get_srid(), gserialized_get_type(), gserialized_has_bbox(), gserialized_max_header_size(), LW_SUCCESS, LWSIZE_GET, POSTGIS_FREE_IF_COPY_P, result, GSERIALIZED::size, and ovdump::type.
Referenced by gserialized_datum_get_gbox_p(), ST_BoundingDiagonal(), and ST_ClipByBox2d().