PostGIS  2.5.7dev-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 581 of file gserialized_estimate.c.

582 {
583  int d = 0;
584  POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
585 
586  nd_box_init(nd_box);
587  nd_box->min[d] = gbox->xmin;
588  nd_box->max[d] = gbox->xmax;
589  d++;
590  nd_box->min[d] = gbox->ymin;
591  nd_box->max[d] = gbox->ymax;
592  d++;
593  if ( FLAGS_GET_GEODETIC(gbox->flags) )
594  {
595  nd_box->min[d] = gbox->zmin;
596  nd_box->max[d] = gbox->zmax;
597  return;
598  }
599  if ( FLAGS_GET_Z(gbox->flags) )
600  {
601  nd_box->min[d] = gbox->zmin;
602  nd_box->max[d] = gbox->zmax;
603  d++;
604  }
605  if ( FLAGS_GET_M(gbox->flags) )
606  {
607  nd_box->min[d] = gbox->mmin;
608  nd_box->max[d] = gbox->mmax;
609  d++;
610  }
611  return;
612 }
char * gbox_to_string(const GBOX *gbox)
Allocate a string representation of the GBOX, based on dimensionality of flags.
Definition: g_box.c:399
static int nd_box_init(ND_BOX *a)
Zero out an ND_BOX.
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
#define FLAGS_GET_GEODETIC(flags)
Definition: liblwgeom.h:143
double ymax
Definition: liblwgeom.h:298
double zmax
Definition: liblwgeom.h:300
double xmax
Definition: liblwgeom.h:296
double zmin
Definition: liblwgeom.h:299
double mmax
Definition: liblwgeom.h:302
double ymin
Definition: liblwgeom.h:297
double xmin
Definition: liblwgeom.h:295
double mmin
Definition: liblwgeom.h:301
uint8_t flags
Definition: liblwgeom.h:294
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: