1067 GISTENTRY *entry = (GISTENTRY*) PG_GETARG_POINTER(0);
1070 StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
1072 bool *recheck = (
bool *) PG_GETARG_POINTER(4);
1074 POSTGIS_DEBUG(4,
"[GIST] 'distance' function called");
1078 if ( strategy != 13 && strategy != 14 ) {
1079 elog(ERROR,
"unrecognized strategy number: %d", strategy);
1080 PG_RETURN_FLOAT8(FLT_MAX);
1086 POSTGIS_DEBUG(4,
"[GIST] null query_gbox_index!");
1087 PG_RETURN_FLOAT8(FLT_MAX);
1091 entry_box = (BOX2DF*)DatumGetPointer(entry->key);
1094 if ( strategy == 14 )
1099 else if ( strategy == 13 )
1106 if (GIST_LEAF(entry))
1111 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)
Peak into a GSERIALIZED datum to find the bounding box.
static double distance(double x1, double y1, double x2, double y2)