PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ gserialized_gist_union()

Datum gserialized_gist_union ( PG_FUNCTION_ARGS  )

Definition at line 1299 of file gserialized_gist_nd.c.

References gidx_copy(), gidx_merge(), gserialized_gist_same(), and PG_FUNCTION_INFO_V1().

Referenced by gserialized_gist_penalty().

1300 {
1301  GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
1302  int *sizep = (int *) PG_GETARG_POINTER(1); /* Size of the return value */
1303  int numranges, i;
1304  GIDX *box_cur, *box_union;
1305 
1306  POSTGIS_DEBUG(4, "[GIST] 'union' function called");
1307 
1308  numranges = entryvec->n;
1309 
1310  box_cur = (GIDX*) DatumGetPointer(entryvec->vector[0].key);
1311 
1312  box_union = gidx_copy(box_cur);
1313 
1314  for ( i = 1; i < numranges; i++ )
1315  {
1316  box_cur = (GIDX*) DatumGetPointer(entryvec->vector[i].key);
1317  gidx_merge(&box_union, box_cur);
1318  }
1319 
1320  *sizep = VARSIZE(box_union);
1321 
1322  POSTGIS_DEBUGF(4, "[GIST] union called, numranges(%i), pageunion %s", numranges, gidx_to_string(box_union));
1323 
1324  PG_RETURN_POINTER(box_union);
1325 
1326 }
static void gidx_merge(GIDX **b_union, GIDX *b_new)
static GIDX * gidx_copy(GIDX *b)
Here is the call graph for this function:
Here is the caller graph for this function: