PostGIS  3.4.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 600 of file gserialized_estimate.c.

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