PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwgeom_maxdistance3d_tolerance()

double lwgeom_maxdistance3d_tolerance ( const LWGEOM lw1,
const LWGEOM lw2,
double  tolerance 
)
extern

Function handling 3d max distance calculations and dfullywithin calculations.

The difference is just the tolerance.

Definition at line 310 of file measures3d.c.

311{
312 if (!lwgeom_has_z(lw1) || !lwgeom_has_z(lw2))
313 {
314 lwnotice(
315 "One or both of the geometries is missing z-value. The unknown z-value will be regarded as \"any value\"");
316 return lwgeom_maxdistance2d_tolerance(lw1, lw2, tolerance);
317 }
318 DISTPTS3D thedl;
319 LWDEBUG(2, "lwgeom_maxdistance3d_tolerance is called");
320 thedl.mode = DIST_MAX;
321 thedl.distance = -1;
322 thedl.tolerance = tolerance;
323 if (lw_dist3d_recursive(lw1, lw2, &thedl))
324 return thedl.distance;
325
326 /* should never get here. all cases ought to be error handled earlier */
327 lwerror("Some unspecified error.");
328 return -1;
329}
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition lwgeom.c:916
double lwgeom_maxdistance2d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
Function handling max distance calculations and dfullywithin calculations.
Definition measures.c:177
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:83
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition lwutil.c:190
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition lwutil.c:177
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:485
#define DIST_MAX
Definition measures.h:43
double distance
Definition measures3d.h:40
double tolerance
Definition measures3d.h:47
Structure used in distance-calculations.
Definition measures3d.h:39

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

Referenced by LWGEOM_dfullywithin3d(), and lwgeom_maxdistance3d().

Here is the call graph for this function:
Here is the caller graph for this function: