PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ box2df_union_size()

static float box2df_union_size ( const BOX2DF *  a,
const BOX2DF *  b 
)
static

Definition at line 228 of file gserialized_gist_2d.c.

References box2df_size(), and box2df_to_string().

Referenced by gserialized_gist_penalty_2d().

229 {
230  float result;
231 
232  POSTGIS_DEBUG(5,"entered function");
233 
234  if ( a == NULL && b == NULL )
235  {
236  elog(ERROR, "box2df_union_size received two null arguments");
237  return 0.0;
238  }
239 
240  if ( a == NULL )
241  return box2df_size(b);
242 
243  if ( b == NULL )
244  return box2df_size(a);
245 
246  result = ((double)Max(a->xmax,b->xmax) - (double)Min(a->xmin,b->xmin)) *
247  ((double)Max(a->ymax,b->ymax) - (double)Min(a->ymin,b->ymin));
248 
249  POSTGIS_DEBUGF(5, "union size of %s and %s is %.8g", box2df_to_string(a), box2df_to_string(b), result);
250 
251  return result;
252 }
static float box2df_size(const BOX2DF *a)
static char * box2df_to_string(const BOX2DF *a)
Here is the call graph for this function:
Here is the caller graph for this function: