PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ _lwt_minTolerance()

static double _lwt_minTolerance ( LWGEOM g)
static

Definition at line 4839 of file lwgeom_topo.c.

References _lwt_minToleranceDouble(), FP_ABS, lwgeom_get_bbox(), GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.

Referenced by _lwt_AddLineEdge(), and _lwt_AddPoint().

4840 {
4841  const GBOX* gbox;
4842  double max;
4843  double ret;
4844 
4845  gbox = lwgeom_get_bbox(g);
4846  if ( ! gbox ) return 0; /* empty */
4847  max = FP_ABS(gbox->xmin);
4848  if ( max < FP_ABS(gbox->xmax) ) max = FP_ABS(gbox->xmax);
4849  if ( max < FP_ABS(gbox->ymin) ) max = FP_ABS(gbox->ymin);
4850  if ( max < FP_ABS(gbox->ymax) ) max = FP_ABS(gbox->ymax);
4851 
4852  ret = _lwt_minToleranceDouble(max);
4853 
4854  return ret;
4855 }
double xmax
Definition: liblwgeom.h:295
double ymin
Definition: liblwgeom.h:296
double xmin
Definition: liblwgeom.h:294
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
Definition: lwgeom.c:734
double ymax
Definition: liblwgeom.h:297
static double _lwt_minToleranceDouble(double d)
Definition: lwgeom_topo.c:4818
#define FP_ABS(a)
Here is the call graph for this function:
Here is the caller graph for this function: