PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum gserialized_gist_union ( PG_FUNCTION_ARGS  )

Definition at line 1110 of file gserialized_gist_nd.c.

References gidx_copy(), and gidx_merge().

1111 {
1112  GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
1113  int *sizep = (int *) PG_GETARG_POINTER(1); /* Size of the return value */
1114  int numranges, i;
1115  GIDX *box_cur, *box_union;
1116 
1117  POSTGIS_DEBUG(4, "[GIST] 'union' function called");
1118 
1119  numranges = entryvec->n;
1120 
1121  box_cur = (GIDX*) DatumGetPointer(entryvec->vector[0].key);
1122 
1123  box_union = gidx_copy(box_cur);
1124 
1125  for ( i = 1; i < numranges; i++ )
1126  {
1127  box_cur = (GIDX*) DatumGetPointer(entryvec->vector[i].key);
1128  gidx_merge(&box_union, box_cur);
1129  }
1130 
1131  *sizep = VARSIZE(box_union);
1132 
1133  POSTGIS_DEBUGF(4, "[GIST] union called, numranges(%i), pageunion %s", numranges, gidx_to_string(box_union));
1134 
1135  PG_RETURN_POINTER(box_union);
1136 
1137 }
static void gidx_merge(GIDX **b_union, GIDX *b_new)
static GIDX * gidx_copy(GIDX *b)

Here is the call graph for this function: