PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ LWGEOM_to_BOX3D()

Datum LWGEOM_to_BOX3D ( PG_FUNCTION_ARGS  )

Definition at line 390 of file lwgeom_box3d.c.

391{
392 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
393 LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
394 GBOX gbox;
395 BOX3D *result;
396 int rv = lwgeom_calculate_gbox(lwgeom, &gbox);
397
398 if (rv == LW_FAILURE)
399 PG_RETURN_NULL();
400
401 result = box3d_from_gbox(&gbox);
402 result->srid = lwgeom->srid;
403
404 lwgeom_free(lwgeom);
405 PG_RETURN_POINTER(result);
406}
BOX3D * box3d_from_gbox(const GBOX *gbox)
Definition gbox.c:53
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
#define LW_FAILURE
Definition liblwgeom.h:110
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1138
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate bounding box of a geometry, automatically taking into account whether it is cartesian or ge...
Definition lwgeom.c:737
int32_t srid
Definition liblwgeom.h:327
int32_t srid
Definition liblwgeom.h:446

References box3d_from_gbox(), LW_FAILURE, lwgeom_calculate_gbox(), lwgeom_free(), lwgeom_from_gserialized(), BOX3D::srid, and LWGEOM::srid.

Referenced by gserialized_contained_3d(), gserialized_contains_3d(), gserialized_overlaps_3d(), gserialized_same_3d(), gserialized_spgist_compress_3d(), gserialized_spgist_inner_consistent_3d(), and gserialized_spgist_leaf_consistent_3d().

Here is the call graph for this function:
Here is the caller graph for this function: