PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ box2df_union_size()

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

Definition at line 195 of file gserialized_gist_2d.c.

References box2df_size(), and box2df_to_string().

Referenced by gserialized_gist_penalty_2d().

196 {
197  float result;
198 
199  POSTGIS_DEBUG(5,"entered function");
200 
201  if ( a == NULL && b == NULL )
202  {
203  elog(ERROR, "box2df_union_size received two null arguments");
204  return 0.0;
205  }
206 
207  if ( a == NULL )
208  return box2df_size(b);
209 
210  if ( b == NULL )
211  return box2df_size(a);
212 
213  result = ((double)Max(a->xmax,b->xmax) - (double)Min(a->xmin,b->xmin)) *
214  ((double)Max(a->ymax,b->ymax) - (double)Min(a->ymin,b->ymin));
215 
216  POSTGIS_DEBUGF(5, "union size of %s and %s is %.8g", box2df_to_string(a), box2df_to_string(b), result);
217 
218  return result;
219 }
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: