PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ nd_box_from_gbox()

static void nd_box_from_gbox ( const GBOX gbox,
ND_BOX nd_box 
)
static

Set the values of an ND_BOX from a GBOX.

Definition at line 597 of file gserialized_estimate.c.

598 {
599  volatile int d = 0;
600  POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
601 
602  nd_box_init(nd_box);
603  nd_box->min[d] = gbox->xmin;
604  nd_box->max[d] = gbox->xmax;
605  d++;
606  nd_box->min[d] = gbox->ymin;
607  nd_box->max[d] = gbox->ymax;
608  d++;
609  if ( FLAGS_GET_GEODETIC(gbox->flags) )
610  {
611  nd_box->min[d] = gbox->zmin;
612  nd_box->max[d] = gbox->zmax;
613  return;
614  }
615  if ( FLAGS_GET_Z(gbox->flags) )
616  {
617  nd_box->min[d] = gbox->zmin;
618  nd_box->max[d] = gbox->zmax;
619  d++;
620  }
621  if ( FLAGS_GET_M(gbox->flags) )
622  {
623  nd_box->min[d] = gbox->mmin;
624  nd_box->max[d] = gbox->mmax;
625  d++;
626  }
627  return;
628 }
char * gbox_to_string(const GBOX *gbox)
Allocate a string representation of the GBOX, based on dimensionality of flags.
Definition: gbox.c:404
static int nd_box_init(ND_BOX *a)
Zero out an ND_BOX.
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:165
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:166
#define FLAGS_GET_GEODETIC(flags)
Definition: liblwgeom.h:168
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
float4 max[ND_DIMS]
float4 min[ND_DIMS]

References GBOX::flags, FLAGS_GET_GEODETIC, FLAGS_GET_M, FLAGS_GET_Z, gbox_to_string(), ND_BOX_T::max, ND_BOX_T::min, GBOX::mmax, GBOX::mmin, nd_box_init(), GBOX::xmax, GBOX::xmin, GBOX::ymax, GBOX::ymin, GBOX::zmax, and GBOX::zmin.

Referenced by compute_gserialized_stats_mode(), and estimate_selectivity().

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