PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ LWGEOM_to_BOX2DF()

Datum LWGEOM_to_BOX2DF ( PG_FUNCTION_ARGS  )

Definition at line 149 of file lwgeom_box.c.

150 {
151  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
152  GBOX gbox;
153 
154  if ( gserialized_get_gbox_p(geom, &gbox) == LW_FAILURE )
155  PG_RETURN_NULL();
156 
157  /* Strip out higher dimensions */
158  FLAGS_SET_Z(gbox.flags, 0);
159  FLAGS_SET_M(gbox.flags, 0);
160 
161  PG_FREE_IF_COPY(geom, 0);
162  PG_RETURN_POINTER(gbox_copy(&gbox));
163 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:433
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box)
Read the bounding box off a serialization and calculate one if it is not already there.
Definition: g_serialized.c:640
#define LW_FAILURE
Definition: liblwgeom.h:79
#define FLAGS_SET_M(flags, value)
Definition: liblwgeom.h:147
#define FLAGS_SET_Z(flags, value)
Definition: liblwgeom.h:146
uint8_t flags
Definition: liblwgeom.h:294

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: