PostGIS  2.1.10dev-r@@SVN_REVISION@@
int geography_dwithin_cache ( FunctionCallInfoData *  fcinfo,
const GSERIALIZED g1,
const GSERIALIZED g2,
const SPHEROID s,
double  tolerance,
int *  dwithin 
)

Definition at line 234 of file geography_measurement_trees.c.

References distance(), FP_TOLERANCE, geography_distance_cache_tolerance(), LW_FAILURE, LW_FALSE, LW_SUCCESS, and LW_TRUE.

Referenced by geography_dwithin().

235 {
236  double distance;
237  /* TODO!!! Why does the tolerance stopper in the circ_tree_distance_tree_internal arbitrarily screw up? */
238 /* if ( LW_SUCCESS == geography_distance_cache_tolerance(fcinfo, g1, g2, s, tolerance, &distance) ) */
239  if ( LW_SUCCESS == geography_distance_cache_tolerance(fcinfo, g1, g2, s, FP_TOLERANCE, &distance) )
240  {
241  *dwithin = (distance <= (tolerance + FP_TOLERANCE) ? LW_TRUE : LW_FALSE);
242  return LW_SUCCESS;
243  }
244  return LW_FAILURE;
245 }
static int geography_distance_cache_tolerance(FunctionCallInfoData *fcinfo, const GSERIALIZED *g1, const GSERIALIZED *g2, const SPHEROID *s, double tolerance, double *distance)
#define LW_SUCCESS
Definition: liblwgeom.h:55
#define LW_FAILURE
Definition: liblwgeom.h:54
#define LW_FALSE
Definition: liblwgeom.h:52
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
#define FP_TOLERANCE
Floating point comparitors.
Datum distance(PG_FUNCTION_ARGS)

Here is the call graph for this function:

Here is the caller graph for this function: