PostGIS  3.1.6dev-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 590 of file gserialized_estimate.c.

591 {
592  int d = 0;
593  POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
594 
595  nd_box_init(nd_box);
596  nd_box->min[d] = gbox->xmin;
597  nd_box->max[d] = gbox->xmax;
598  d++;
599  nd_box->min[d] = gbox->ymin;
600  nd_box->max[d] = gbox->ymax;
601  d++;
602  if ( FLAGS_GET_GEODETIC(gbox->flags) )
603  {
604  nd_box->min[d] = gbox->zmin;
605  nd_box->max[d] = gbox->zmax;
606  return;
607  }
608  if ( FLAGS_GET_Z(gbox->flags) )
609  {
610  nd_box->min[d] = gbox->zmin;
611  nd_box->max[d] = gbox->zmax;
612  d++;
613  }
614  if ( FLAGS_GET_M(gbox->flags) )
615  {
616  nd_box->min[d] = gbox->mmin;
617  nd_box->max[d] = gbox->mmax;
618  d++;
619  }
620  return;
621 }
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:179
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:180
#define FLAGS_GET_GEODETIC(flags)
Definition: liblwgeom.h:182
double ymax
Definition: liblwgeom.h:371
double zmax
Definition: liblwgeom.h:373
double xmax
Definition: liblwgeom.h:369
double zmin
Definition: liblwgeom.h:372
double mmax
Definition: liblwgeom.h:375
double ymin
Definition: liblwgeom.h:370
double xmin
Definition: liblwgeom.h:368
double mmin
Definition: liblwgeom.h:374
lwflags_t flags
Definition: liblwgeom.h:367
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: