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

◆ LWGEOM_to_BOX2DF()

Datum LWGEOM_to_BOX2DF ( PG_FUNCTION_ARGS  )

Definition at line 147 of file lwgeom_box.c.

148{
149 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
150 GBOX gbox;
151
152 if ( gserialized_get_gbox_p(geom, &gbox) == LW_FAILURE )
153 PG_RETURN_NULL();
154
155 /* Strip out higher dimensions */
156 FLAGS_SET_Z(gbox.flags, 0);
157 FLAGS_SET_M(gbox.flags, 0);
158
159 PG_FREE_IF_COPY(geom, 0);
160 PG_RETURN_POINTER(gbox_copy(&gbox));
161}
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition gbox.c:426
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *gbox)
Read the box from the GSERIALIZED or calculate it if necessary.
Definition gserialized.c:65
#define LW_FAILURE
Definition liblwgeom.h:110
#define FLAGS_SET_M(flags, value)
Definition liblwgeom.h:187
#define FLAGS_SET_Z(flags, value)
Definition liblwgeom.h:186
lwflags_t flags
Definition liblwgeom.h:339

References GBOX::flags, FLAGS_SET_M, FLAGS_SET_Z, gbox_copy(), gserialized_get_gbox_p(), and LW_FAILURE.

Here is the call graph for this function: