PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum gserialized_gist_union_2d ( PG_FUNCTION_ARGS  )

Definition at line 1434 of file gserialized_gist_2d.c.

References box2df_copy(), box2df_merge(), and box2df_to_string().

1435 {
1436  GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
1437  int *sizep = (int *) PG_GETARG_POINTER(1); /* Size of the return value */
1438  int numranges, i;
1439  BOX2DF *box_cur, *box_union;
1440 
1441  POSTGIS_DEBUG(4, "[GIST] 'union' function called");
1442 
1443  numranges = entryvec->n;
1444 
1445  box_cur = (BOX2DF*) DatumGetPointer(entryvec->vector[0].key);
1446 
1447  box_union = box2df_copy(box_cur);
1448 
1449  for ( i = 1; i < numranges; i++ )
1450  {
1451  box_cur = (BOX2DF*) DatumGetPointer(entryvec->vector[i].key);
1452  box2df_merge(box_union, box_cur);
1453  }
1454 
1455  *sizep = sizeof(BOX2DF);
1456 
1457  POSTGIS_DEBUGF(4, "[GIST] 'union', numranges(%i), pageunion %s", numranges, box2df_to_string(box_union));
1458 
1459  PG_RETURN_POINTER(box_union);
1460 
1461 }
BOX2DF * box2df_copy(BOX2DF *b)
static char * box2df_to_string(const BOX2DF *a)
void box2df_merge(BOX2DF *b_union, BOX2DF *b_new)

Here is the call graph for this function: