PostGIS  2.1.10dev-r@@SVN_REVISION@@
double lwgeom_mindistance2d_tolerance ( LWGEOM lw1,
LWGEOM lw2,
double  tolerance 
)

Function handling min distance calculations and dwithin calculations.

The difference is just the tolerance.

Definition at line 173 of file measures.c.

References DIST_MIN, DISTPTS::distance, lw_dist2d_comp(), LWDEBUG, lwerror(), MAXFLOAT, DISTPTS::mode, and DISTPTS::tolerance.

Referenced by do_test_mindistance2d_tolerance(), LWGEOM_dwithin(), lwgeom_mindistance2d(), and rt_raster_within_distance().

174 {
175  DISTPTS thedl;
176  LWDEBUG(2, "lwgeom_mindistance2d_tolerance is called");
177  thedl.mode = DIST_MIN;
178  thedl.distance= MAXFLOAT;
179  thedl.tolerance = tolerance;
180  if (lw_dist2d_comp( lw1,lw2,&thedl))
181  {
182  return thedl.distance;
183  }
184  /*should never get here. all cases ought to be error handled earlier*/
185  lwerror("Some unspecified error.");
186  return MAXFLOAT;
187 }
int lw_dist2d_comp(LWGEOM *lw1, LWGEOM *lw2, DISTPTS *dl)
This function just deserializes geometries Bboxes is not checked here since it is the subgeometries b...
Definition: measures.c:205
int mode
Definition: measures.h:26
#define DIST_MIN
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
double tolerance
Definition: measures.h:28
double distance
Definition: measures.h:23
#define MAXFLOAT
Largest float value.
Structure used in distance-calculations.
Definition: measures.h:21

Here is the call graph for this function:

Here is the caller graph for this function: