PostGIS  2.4.9dev-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 542 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().

543 {
544  int d = 0;
545  POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
546 
547  nd_box_init(nd_box);
548  nd_box->min[d] = gbox->xmin;
549  nd_box->max[d] = gbox->xmax;
550  d++;
551  nd_box->min[d] = gbox->ymin;
552  nd_box->max[d] = gbox->ymax;
553  d++;
554  if ( FLAGS_GET_GEODETIC(gbox->flags) )
555  {
556  nd_box->min[d] = gbox->zmin;
557  nd_box->max[d] = gbox->zmax;
558  return;
559  }
560  if ( FLAGS_GET_Z(gbox->flags) )
561  {
562  nd_box->min[d] = gbox->zmin;
563  nd_box->max[d] = gbox->zmax;
564  d++;
565  }
566  if ( FLAGS_GET_M(gbox->flags) )
567  {
568  nd_box->min[d] = gbox->mmin;
569  nd_box->max[d] = gbox->mmax;
570  d++;
571  }
572  return;
573 }
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:143
double xmax
Definition: liblwgeom.h:293
static int nd_box_init(ND_BOX *a)
Zero out an ND_BOX.
double zmax
Definition: liblwgeom.h:297
double ymin
Definition: liblwgeom.h:294
double xmin
Definition: liblwgeom.h:292
double ymax
Definition: liblwgeom.h:295
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
uint8_t flags
Definition: liblwgeom.h:291
float4 max[ND_DIMS]
float4 min[ND_DIMS]
double mmin
Definition: liblwgeom.h:298
double zmin
Definition: liblwgeom.h:296
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
double mmax
Definition: liblwgeom.h:299
Here is the call graph for this function:
Here is the caller graph for this function: