PostGIS  2.4.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 610 of file gserialized_estimate.c.

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

Referenced by compute_gserialized_stats_mode().

611 {
612  int d;
613  double size;
614  for ( d = 0; d < ND_DIMS; d++ )
615  {
616  size = nd_box->max[d] - nd_box->min[d];
617  /* Avoid expanding boxes that are either too wide or too narrow*/
618  if (size < MIN_DIMENSION_WIDTH || size > MAX_DIMENSION_WIDTH)
619  continue;
620  nd_box->min[d] -= size * expansion_factor / 2;
621  nd_box->max[d] += size * expansion_factor / 2;
622  }
623  return TRUE;
624 }
#define ND_DIMS
The maximum number of dimensions our code can handle.
float4 max[ND_DIMS]
float4 min[ND_DIMS]
#define TRUE
Definition: dbfopen.c:169
#define MAX_DIMENSION_WIDTH
Maximum width of a dimension that we&#39;ll bother trying to compute statistics on.
Here is the caller graph for this function: