1149 GISTENTRY *entry = (GISTENTRY*) PG_GETARG_POINTER(0);
1152 StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
1154 bool *recheck = (
bool *) PG_GETARG_POINTER(4);
1156 POSTGIS_DEBUG(4,
"[GIST] 'distance' function called");
1160 if ( strategy != 13 && strategy != 14 ) {
1161 elog(ERROR,
"unrecognized strategy number: %d", strategy);
1162 PG_RETURN_FLOAT8(FLT_MAX);
1168 POSTGIS_DEBUG(4,
"[GIST] null query_gbox_index!");
1169 PG_RETURN_FLOAT8(FLT_MAX);
1173 entry_box = (BOX2DF*)DatumGetPointer(entry->key);
1176 if ( strategy == 14 )
1181 else if ( strategy == 13 )
1188 if (GIST_LEAF(entry))
1193 elog(ERROR,
"%s: reached unreachable code", __func__);
static double box2df_distance(const BOX2DF *a, const BOX2DF *b)
Calculate the box->box distance.
int gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df)
static double distance(double x1, double y1, double x2, double y2)