PostGIS  2.1.10dev-r@@SVN_REVISION@@
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 507 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().

508 {
509  int d = 0;
510  POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
511 
512  nd_box_init(nd_box);
513  nd_box->min[d] = gbox->xmin;
514  nd_box->max[d] = gbox->xmax;
515  d++;
516  nd_box->min[d] = gbox->ymin;
517  nd_box->max[d] = gbox->ymax;
518  d++;
519  if ( FLAGS_GET_GEODETIC(gbox->flags) )
520  {
521  nd_box->min[d] = gbox->zmin;
522  nd_box->max[d] = gbox->zmax;
523  return;
524  }
525  if ( FLAGS_GET_Z(gbox->flags) )
526  {
527  nd_box->min[d] = gbox->zmin;
528  nd_box->max[d] = gbox->zmax;
529  d++;
530  }
531  if ( FLAGS_GET_M(gbox->flags) )
532  {
533  nd_box->min[d] = gbox->mmin;
534  nd_box->max[d] = gbox->mmax;
535  d++;
536  }
537  return;
538 }
char * gbox_to_string(const GBOX *gbox)
Allocate a string representation of the GBOX, based on dimensionality of flags.
Definition: g_box.c:328
#define FLAGS_GET_GEODETIC(flags)
Definition: liblwgeom.h:109
double xmax
Definition: liblwgeom.h:249
static int nd_box_init(ND_BOX *a)
Zero out an ND_BOX.
double zmax
Definition: liblwgeom.h:253
double ymin
Definition: liblwgeom.h:250
double xmin
Definition: liblwgeom.h:248
double ymax
Definition: liblwgeom.h:251
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
uint8_t flags
Definition: liblwgeom.h:247
float4 max[ND_DIMS]
float4 min[ND_DIMS]
double mmin
Definition: liblwgeom.h:254
double zmin
Definition: liblwgeom.h:252
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:107
double mmax
Definition: liblwgeom.h:255

Here is the call graph for this function:

Here is the caller graph for this function: