#include "liblwgeom.h" /* For standard geometry types. */
#include "lwgeom_pg.h" /* For debugging macros. */
#include "gserialized_gist.h" /* For utility functions. */
+#include "liblwgeom_internal.h" /* For MAXFLOAT */
/*
** When is a node split not so good? If more than 90% of the entries
return b->ymin - a->ymax;
}
- return INFINITY;
+ return MAXFLOAT;
}
POSTGIS_DEBUGF(3, "got boxes %s and %s", box2df_to_string(&b1), box2df_to_string(&b2));
PG_RETURN_FLOAT8(distance);
}
- PG_RETURN_FLOAT8(INFINITY);
+ PG_RETURN_FLOAT8(MAXFLOAT);
}
PG_FUNCTION_INFO_V1(gserialized_distance_box_2d);
POSTGIS_DEBUGF(3, "got boxes %s and %s", box2df_to_string(&b1), box2df_to_string(&b2));
PG_RETURN_FLOAT8(distance);
}
- PG_RETURN_FLOAT8(INFINITY);
+ PG_RETURN_FLOAT8(MAXFLOAT);
}
PG_FUNCTION_INFO_V1(gserialized_same_2d);
* and '14' as the gist distance-between-boxes strategy number */
if ( strategy != 13 && strategy != 14 ) {
elog(ERROR, "unrecognized strategy number: %d", strategy);
- PG_RETURN_FLOAT8(INFINITY);
+ PG_RETURN_FLOAT8(MAXFLOAT);
}
/* Null box should never make this far. */
if ( gserialized_datum_get_box2df_p(PG_GETARG_DATUM(1), &query_box) == LW_FAILURE )
{
POSTGIS_DEBUG(4, "[GIST] null query_gbox_index!");
- PG_RETURN_FLOAT8(INFINITY);
+ PG_RETURN_FLOAT8(MAXFLOAT);
}
/* Get the entry box */