1462 GISTENTRY *entry = (GISTENTRY*) PG_GETARG_POINTER(0);
1463 Datum query_datum = PG_GETARG_DATUM(1);
1464 StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
1465 #if POSTGIS_PGSQL_VERSION >= 95
1466 bool *recheck = (
bool *) PG_GETARG_POINTER(4);
1468 char query_box_mem[GIDX_MAX_SIZE];
1469 GIDX *query_box = (GIDX*)query_box_mem;
1473 POSTGIS_DEBUGF(3,
"[GIST] '%s' function called", __func__);
1476 if ( strategy != 13 )
1478 elog(ERROR,
"unrecognized strategy number: %d", strategy);
1479 PG_RETURN_FLOAT8(FLT_MAX);
1483 if ( gserialized_datum_get_gidx_p(query_datum, query_box) ==
LW_FAILURE )
1485 POSTGIS_DEBUG(2,
"[GIST] null query_gbox_index!");
1486 PG_RETURN_FLOAT8(FLT_MAX);
1489 #if POSTGIS_PGSQL_VERSION >= 95
1491 if (GIST_LEAF(entry))
1498 entry_box = (GIDX*)DatumGetPointer(entry->key);
1506 POSTGIS_DEBUGF(2,
"[GIST] '%s' got distance %g", __func__,
distance);
static double gidx_distance(const GIDX *a, const GIDX *b, int m_is_time)
Calculate the centroid->centroid distance between the boxes.
Datum distance(PG_FUNCTION_ARGS)