1461 GISTENTRY *entry = (GISTENTRY*) PG_GETARG_POINTER(0);
1462 Datum query_datum = PG_GETARG_DATUM(1);
1463 StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
1464 #if POSTGIS_PGSQL_VERSION >= 95 1465 bool *recheck = (
bool *) PG_GETARG_POINTER(4);
1467 char query_box_mem[GIDX_MAX_SIZE];
1468 GIDX *query_box = (GIDX*)query_box_mem;
1472 POSTGIS_DEBUGF(3,
"[GIST] '%s' function called", __func__);
1475 if ( strategy != 13 )
1477 elog(ERROR,
"unrecognized strategy number: %d", strategy);
1478 PG_RETURN_FLOAT8(FLT_MAX);
1482 if ( gserialized_datum_get_gidx_p(query_datum, query_box) ==
LW_FAILURE )
1484 POSTGIS_DEBUG(2,
"[GIST] null query_gbox_index!");
1485 PG_RETURN_FLOAT8(FLT_MAX);
1488 #if POSTGIS_PGSQL_VERSION >= 95 1490 if (GIST_LEAF(entry))
1497 entry_box = (GIDX*)DatumGetPointer(entry->key);
1505 POSTGIS_DEBUGF(2,
"[GIST] '%s' got distance %g", __func__, distance);
1507 PG_RETURN_FLOAT8(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)