PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ nd_box_expand()

static int nd_box_expand ( ND_BOX nd_box,
double  expansion_factor 
)
static

Expand an ND_BOX ever so slightly.

Expand parameter is the proportion of total width to add.

Definition at line 658 of file gserialized_estimate.c.

659 {
660  int d;
661  double size;
662  for ( d = 0; d < ND_DIMS; d++ )
663  {
664  size = nd_box->max[d] - nd_box->min[d];
665  /* Avoid expanding boxes that are either too wide or too narrow*/
666  if (size < MIN_DIMENSION_WIDTH || size > MAX_DIMENSION_WIDTH)
667  continue;
668  nd_box->min[d] -= size * expansion_factor / 2;
669  nd_box->max[d] += size * expansion_factor / 2;
670  }
671  return true;
672 }
#define ND_DIMS
The maximum number of dimensions our code can handle.
#define MAX_DIMENSION_WIDTH
Maximum width of a dimension that we'll bother trying to compute statistics on.
float4 max[ND_DIMS]
float4 min[ND_DIMS]

References ND_BOX_T::max, MAX_DIMENSION_WIDTH, ND_BOX_T::min, and ND_DIMS.

Referenced by compute_gserialized_stats_mode().

Here is the caller graph for this function: