1130 GISTENTRY *entry = (GISTENTRY*) PG_GETARG_POINTER(0);
1133 StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
1135 bool *recheck = (
bool *) PG_GETARG_POINTER(4);
1137 POSTGIS_DEBUG(4,
"[GIST] 'distance' function called");
1141 if ( strategy != 13 && strategy != 14 ) {
1142 elog(ERROR,
"unrecognized strategy number: %d", strategy);
1143 PG_RETURN_FLOAT8(FLT_MAX);
1149 POSTGIS_DEBUG(4,
"[GIST] null query_gbox_index!");
1150 PG_RETURN_FLOAT8(FLT_MAX);
1154 entry_box = (BOX2DF*)DatumGetPointer(entry->key);
1157 if ( strategy == 14 )
1162 else if ( strategy == 13 )
1169 if (GIST_LEAF(entry))
1174 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)