PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ _lwt_minTolerance()

static double _lwt_minTolerance ( LWGEOM g)
static

Definition at line 4951 of file lwgeom_topo.c.

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

Referenced by lwt_AddPoint().

4952 {
4953  const GBOX* gbox;
4954  double max;
4955  double ret;
4956 
4957  gbox = lwgeom_get_bbox(g);
4958  if ( ! gbox ) return 0; /* empty */
4959  max = FP_ABS(gbox->xmin);
4960  if ( max < FP_ABS(gbox->xmax) ) max = FP_ABS(gbox->xmax);
4961  if ( max < FP_ABS(gbox->ymin) ) max = FP_ABS(gbox->ymin);
4962  if ( max < FP_ABS(gbox->ymax) ) max = FP_ABS(gbox->ymax);
4963 
4964  ret = 3.6 * pow(10, - ( 15 - log10(max?max:1.0) ) );
4965 
4966  return ret;
4967 }
double xmax
Definition: liblwgeom.h:277
double ymin
Definition: liblwgeom.h:278
double xmin
Definition: liblwgeom.h:276
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:640
double ymax
Definition: liblwgeom.h:279
#define FP_ABS(a)
Here is the call graph for this function:
Here is the caller graph for this function: