PostGIS  2.3.7dev-r@@SVN_REVISION@@
static double _lwt_minTolerance ( LWGEOM g)
static

Definition at line 4981 of file lwgeom_topo.c.

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

Referenced by lwt_AddPoint().

4982 {
4983  const GBOX* gbox;
4984  double max;
4985  double ret;
4986 
4987  gbox = lwgeom_get_bbox(g);
4988  if ( ! gbox ) return 0; /* empty */
4989  max = FP_ABS(gbox->xmin);
4990  if ( max < FP_ABS(gbox->xmax) ) max = FP_ABS(gbox->xmax);
4991  if ( max < FP_ABS(gbox->ymin) ) max = FP_ABS(gbox->ymin);
4992  if ( max < FP_ABS(gbox->ymax) ) max = FP_ABS(gbox->ymax);
4993 
4994  ret = 3.6 * pow(10, - ( 15 - log10(max?max:1.0) ) );
4995 
4996  return ret;
4997 }
double xmax
Definition: liblwgeom.h:292
double ymin
Definition: liblwgeom.h:293
double xmin
Definition: liblwgeom.h:291
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:653
double ymax
Definition: liblwgeom.h:294
#define FP_ABS(a)

Here is the call graph for this function:

Here is the caller graph for this function: