PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_mindistance3d_tolerance()

double lwgeom_mindistance3d_tolerance ( const LWGEOM lw1,
const LWGEOM lw2,
double  tolerance 

Function handling 3d min distance calculations and dwithin calculations.

The difference is just the tolerance.

Definition at line 339 of file measures3d.c.

References DIST_MIN, DISTPTS3D::distance, lw_dist3d_recursive(), LWDEBUG, lwerror(), lwgeom_has_z(), lwgeom_mindistance2d_tolerance(), lwnotice(), DISTPTS3D::mode, and DISTPTS3D::tolerance.

Referenced by intersects3d_dwithin(), LWGEOM_dwithin3d(), and lwgeom_mindistance3d().

340 {
341  if(!lwgeom_has_z(lw1) || !lwgeom_has_z(lw2))
342  {
343  lwnotice("One or both of the geometries is missing z-value. The unknown z-value will be regarded as \"any value\"");
345  return lwgeom_mindistance2d_tolerance(lw1, lw2, tolerance);
346  }
347  DISTPTS3D thedl;
348  LWDEBUG(2, "lwgeom_mindistance3d_tolerance is called");
349  thedl.mode = DIST_MIN;
350  thedl.distance= FLT_MAX;
351  thedl.tolerance = tolerance;
352  if (lw_dist3d_recursive(lw1, lw2, &thedl))
353  {
354  return thedl.distance;
355  }
356  /*should never get here. all cases ought to be error handled earlier*/
357  lwerror("Some unspecified error.");
358  return FLT_MAX;
359 }
double distance
Definition: measures3d.h:27
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:61
double lwgeom_mindistance2d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
Function handling min distance calculations and dwithin calculations.
Definition: measures.c:199
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
Structure used in distance-calculations.
Definition: measures3d.h:25
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition: lwgeom.c:836
#define DIST_MIN
Definition: measures.h:17
int mode
Definition: measures3d.h:30
int lw_dist3d_recursive(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS3D *dl)
This is a recursive function delivering every possible combination of subgeometries.
Definition: measures3d.c:375
double tolerance
Definition: measures3d.h:32
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
Here is the call graph for this function:
Here is the caller graph for this function: