PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ fallbackSplit()

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

Definition at line 1426 of file gserialized_gist_2d.c.

1427 {
1428  OffsetNumber i,
1429  maxoff;
1430  BOX2DF *unionL = NULL,
1431  *unionR = NULL;
1432  int nbytes;
1433 
1434  maxoff = entryvec->n - 1;
1435 
1436  nbytes = (maxoff + 2) * sizeof(OffsetNumber);
1437  v->spl_left = (OffsetNumber *) palloc(nbytes);
1438  v->spl_right = (OffsetNumber *) palloc(nbytes);
1439  v->spl_nleft = v->spl_nright = 0;
1440 
1441  for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1442  {
1443  BOX2DF *cur = (BOX2DF *) DatumGetPointer(entryvec->vector[i].key);
1444 
1445  if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1446  {
1447  v->spl_left[v->spl_nleft] = i;
1448  if (unionL == NULL)
1449  {
1450  unionL = (BOX2DF *) palloc(sizeof(BOX2DF));
1451  *unionL = *cur;
1452  }
1453  else
1454  adjustBox(unionL, cur);
1455 
1456  v->spl_nleft++;
1457  }
1458  else
1459  {
1460  v->spl_right[v->spl_nright] = i;
1461  if (unionR == NULL)
1462  {
1463  unionR = (BOX2DF *) palloc(sizeof(BOX2DF));
1464  *unionR = *cur;
1465  }
1466  else
1467  adjustBox(unionR, cur);
1468 
1469  v->spl_nright++;
1470  }
1471  }
1472 
1473  if (v->spl_ldatum_exists)
1474  adjustBox(unionL, (BOX2DF *) DatumGetPointer(v->spl_ldatum));
1475  v->spl_ldatum = PointerGetDatum(unionL);
1476 
1477  if (v->spl_rdatum_exists)
1478  adjustBox(unionR, (BOX2DF *) DatumGetPointer(v->spl_rdatum));
1479  v->spl_rdatum = PointerGetDatum(unionR);
1480 
1481  v->spl_ldatum_exists = v->spl_rdatum_exists = false;
1482 }
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: