PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ fallbackSplit()

static void fallbackSplit ( GistEntryVector *  entryvec,
GIST_SPLITVEC *  v 
)
static

Definition at line 1511 of file gserialized_gist_2d.c.

1512 {
1513  OffsetNumber i,
1514  maxoff;
1515  BOX2DF *unionL = NULL,
1516  *unionR = NULL;
1517  int nbytes;
1518 
1519  maxoff = entryvec->n - 1;
1520 
1521  nbytes = (maxoff + 2) * sizeof(OffsetNumber);
1522  v->spl_left = (OffsetNumber *) palloc(nbytes);
1523  v->spl_right = (OffsetNumber *) palloc(nbytes);
1524  v->spl_nleft = v->spl_nright = 0;
1525 
1526  for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1527  {
1528  BOX2DF *cur = (BOX2DF *) DatumGetPointer(entryvec->vector[i].key);
1529 
1530  if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1531  {
1532  v->spl_left[v->spl_nleft] = i;
1533  if (unionL == NULL)
1534  {
1535  unionL = (BOX2DF *) palloc(sizeof(BOX2DF));
1536  *unionL = *cur;
1537  }
1538  else
1539  adjustBox(unionL, cur);
1540 
1541  v->spl_nleft++;
1542  }
1543  else
1544  {
1545  v->spl_right[v->spl_nright] = i;
1546  if (unionR == NULL)
1547  {
1548  unionR = (BOX2DF *) palloc(sizeof(BOX2DF));
1549  *unionR = *cur;
1550  }
1551  else
1552  adjustBox(unionR, cur);
1553 
1554  v->spl_nright++;
1555  }
1556  }
1557 
1558  if (v->spl_ldatum_exists)
1559  adjustBox(unionL, (BOX2DF *) DatumGetPointer(v->spl_ldatum));
1560  v->spl_ldatum = BoxPGetDatum(unionL);
1561 
1562  if (v->spl_rdatum_exists)
1563  adjustBox(unionR, (BOX2DF *) DatumGetPointer(v->spl_rdatum));
1564  v->spl_rdatum = BoxPGetDatum(unionR);
1565 
1566  v->spl_ldatum_exists = v->spl_rdatum_exists = false;
1567 }
static void adjustBox(BOX2DF *b, BOX2DF *addon)

References adjustBox(), and rtgdalraster::cur.

Referenced by gserialized_gist_picksplit_2d().

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