1267 GISTENTRY *entry = (GISTENTRY *)PG_GETARG_POINTER(0);
1268 Datum query_datum = PG_GETARG_DATUM(1);
1269 StrategyNumber strategy = (StrategyNumber)PG_GETARG_UINT16(2);
1270 bool *recheck = (
bool *)PG_GETARG_POINTER(4);
1271 char query_box_mem[GIDX_MAX_SIZE];
1272 GIDX *query_box = (GIDX *)query_box_mem;
1276 POSTGIS_DEBUGF(3,
"[GIST] '%s' function called", __func__);
1281 elog(ERROR,
"unrecognized strategy number: %d", strategy);
1282 PG_RETURN_FLOAT8(FLT_MAX);
1286 if (gserialized_datum_get_gidx_p(query_datum, query_box) ==
LW_FAILURE)
1288 POSTGIS_DEBUG(2,
"[GIST] null query_gbox_index!");
1289 PG_RETURN_FLOAT8(FLT_MAX);
1293 if (GIST_LEAF(entry))
1297 entry_box = (GIDX *)DatumGetPointer(entry->key);
1305 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 box->box distance.
static double distance(double x1, double y1, double x2, double y2)