PostGIS  2.3.8dev-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 532 of file gserialized_estimate.c.

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().

533 {
534  int d = 0;
535  POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
536 
537  nd_box_init(nd_box);
538  nd_box->min[d] = gbox->xmin;
539  nd_box->max[d] = gbox->xmax;
540  d++;
541  nd_box->min[d] = gbox->ymin;
542  nd_box->max[d] = gbox->ymax;
543  d++;
544  if ( FLAGS_GET_GEODETIC(gbox->flags) )
545  {
546  nd_box->min[d] = gbox->zmin;
547  nd_box->max[d] = gbox->zmax;
548  return;
549  }
550  if ( FLAGS_GET_Z(gbox->flags) )
551  {
552  nd_box->min[d] = gbox->zmin;
553  nd_box->max[d] = gbox->zmax;
554  d++;
555  }
556  if ( FLAGS_GET_M(gbox->flags) )
557  {
558  nd_box->min[d] = gbox->mmin;
559  nd_box->max[d] = gbox->mmax;
560  d++;
561  }
562  return;
563 }
char * gbox_to_string(const GBOX *gbox)
Allocate a string representation of the GBOX, based on dimensionality of flags.
Definition: g_box.c:404
#define FLAGS_GET_GEODETIC(flags)
Definition: liblwgeom.h:142
double xmax
Definition: liblwgeom.h:292
static int nd_box_init(ND_BOX *a)
Zero out an ND_BOX.
double zmax
Definition: liblwgeom.h:296
double ymin
Definition: liblwgeom.h:293
double xmin
Definition: liblwgeom.h:291
double ymax
Definition: liblwgeom.h:294
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
uint8_t flags
Definition: liblwgeom.h:290
float4 max[ND_DIMS]
float4 min[ND_DIMS]
double mmin
Definition: liblwgeom.h:297
double zmin
Definition: liblwgeom.h:295
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:140
double mmax
Definition: liblwgeom.h:298
Here is the call graph for this function:
Here is the caller graph for this function: