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

◆ gserialized2_read_gbox_p()

int gserialized2_read_gbox_p ( const GSERIALIZED g,
GBOX gbox 
)
static

Definition at line 314 of file gserialized2.c.

315{
316 /* Null input! */
317 if (!(g && gbox)) return LW_FAILURE;
318
319 uint8_t gflags = g->gflags;
320
321 /* Initialize the flags on the box */
323
324 /* Has pre-calculated box */
325 if (G2FLAGS_GET_BBOX(gflags))
326 {
327 int i = 0;
328 const float *fbox = gserialized2_get_float_box_p(g, NULL);
329 gbox->xmin = fbox[i++];
330 gbox->xmax = fbox[i++];
331 gbox->ymin = fbox[i++];
332 gbox->ymax = fbox[i++];
333
334 /* Geodetic? Read next dimension (geocentric Z) and return */
335 if (G2FLAGS_GET_GEODETIC(gflags))
336 {
337 gbox->zmin = fbox[i++];
338 gbox->zmax = fbox[i++];
339 return LW_SUCCESS;
340 }
341 /* Cartesian? Read extra dimensions (if there) and return */
342 if (G2FLAGS_GET_Z(gflags))
343 {
344 gbox->zmin = fbox[i++];
345 gbox->zmax = fbox[i++];
346 }
347 if (G2FLAGS_GET_M(gflags))
348 {
349 gbox->mmin = fbox[i++];
350 gbox->mmax = fbox[i++];
351 }
352 return LW_SUCCESS;
353 }
354 return LW_FAILURE;
355}
const float * gserialized2_get_float_box_p(const GSERIALIZED *g, size_t *ndims)
Point into the float box area of the serialization.
lwflags_t gserialized2_get_lwflags(const GSERIALIZED *g)
Read the flags from a GSERIALIZED and return a standard lwflag integer.
#define G2FLAGS_GET_BBOX(gflags)
#define G2FLAGS_GET_GEODETIC(gflags)
#define G2FLAGS_GET_Z(gflags)
#define G2FLAGS_GET_M(gflags)
#define LW_FAILURE
Definition liblwgeom.h:96
#define LW_SUCCESS
Definition liblwgeom.h:97
double ymax
Definition liblwgeom.h:357
double zmax
Definition liblwgeom.h:359
double xmax
Definition liblwgeom.h:355
double zmin
Definition liblwgeom.h:358
double mmax
Definition liblwgeom.h:361
double ymin
Definition liblwgeom.h:356
double xmin
Definition liblwgeom.h:354
double mmin
Definition liblwgeom.h:360
lwflags_t flags
Definition liblwgeom.h:353
uint8_t gflags
Definition liblwgeom.h:446

References GBOX::flags, G2FLAGS_GET_BBOX, G2FLAGS_GET_GEODETIC, G2FLAGS_GET_M, G2FLAGS_GET_Z, GSERIALIZED::gflags, gserialized2_get_float_box_p(), gserialized2_get_lwflags(), LW_FAILURE, LW_SUCCESS, GBOX::mmax, GBOX::mmin, GBOX::xmax, GBOX::xmin, GBOX::ymax, GBOX::ymin, GBOX::zmax, and GBOX::zmin.

Referenced by gserialized2_fast_gbox_p(), gserialized2_get_gbox_p(), and lwgeom_from_gserialized2().

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