PostGIS  3.0.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 573 of file gserialized_estimate.c.

574 {
575  int d = 0;
576  POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
577 
578  nd_box_init(nd_box);
579  nd_box->min[d] = gbox->xmin;
580  nd_box->max[d] = gbox->xmax;
581  d++;
582  nd_box->min[d] = gbox->ymin;
583  nd_box->max[d] = gbox->ymax;
584  d++;
585  if ( FLAGS_GET_GEODETIC(gbox->flags) )
586  {
587  nd_box->min[d] = gbox->zmin;
588  nd_box->max[d] = gbox->zmax;
589  return;
590  }
591  if ( FLAGS_GET_Z(gbox->flags) )
592  {
593  nd_box->min[d] = gbox->zmin;
594  nd_box->max[d] = gbox->zmax;
595  d++;
596  }
597  if ( FLAGS_GET_M(gbox->flags) )
598  {
599  nd_box->min[d] = gbox->mmin;
600  nd_box->max[d] = gbox->mmax;
601  d++;
602  }
603  return;
604 }
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:343
double zmax
Definition: liblwgeom.h:345
double xmax
Definition: liblwgeom.h:341
double zmin
Definition: liblwgeom.h:344
double mmax
Definition: liblwgeom.h:347
double ymin
Definition: liblwgeom.h:342
double xmin
Definition: liblwgeom.h:340
double mmin
Definition: liblwgeom.h:346
lwflags_t flags
Definition: liblwgeom.h:339
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: