PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ box2df_union_size()

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

Definition at line 253 of file gserialized_gist_2d.c.

254 {
255  float result;
256 
257  POSTGIS_DEBUG(5,"entered function");
258 
259  if ( a == NULL && b == NULL )
260  {
261  elog(ERROR, "box2df_union_size received two null arguments");
262  return 0.0;
263  }
264 
265  if ( a == NULL || box2df_is_empty(a) )
266  return box2df_size(b);
267 
268  if ( b == NULL || box2df_is_empty(b) )
269  return box2df_size(a);
270 
271  result = ((double)Max(a->xmax,b->xmax) - (double)Min(a->xmin,b->xmin)) *
272  ((double)Max(a->ymax,b->ymax) - (double)Min(a->ymin,b->ymin));
273 
274  POSTGIS_DEBUGF(5, "union size of %s and %s is %.8g", box2df_to_string(a), box2df_to_string(b), result);
275 
276  return result;
277 }
static char * box2df_to_string(const BOX2DF *a)
static float box2df_size(const BOX2DF *a)
bool box2df_is_empty(const BOX2DF *a)

References box2df_is_empty(), box2df_size(), and box2df_to_string().

Referenced by gserialized_gist_penalty_2d().

Here is the call graph for this function:
Here is the caller graph for this function: