PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ gidx_distance_m()

static double gidx_distance_m ( const GIDX *  a,
const GIDX *  b 
)
static

Definition at line 741 of file gserialized_gist_nd.c.

742 {
743  int mdim_a, mdim_b;
744  double d, amin, amax, bmin, bmax;
745 
746  /* Base computation on least available dimensions */
747  mdim_a = GIDX_NDIMS(a) - 1;
748  mdim_b = GIDX_NDIMS(b) - 1;
749 
750  amin = GIDX_GET_MIN(a,mdim_a);
751  amax = GIDX_GET_MAX(a,mdim_a);
752  bmin = GIDX_GET_MIN(b,mdim_b);
753  bmax = GIDX_GET_MAX(b,mdim_b);
754 
755  if ( ( amin <= bmax && amax >= bmin ) )
756  {
757  /* overlaps */
758  d = 0;
759  }
760  else if ( bmax < amin )
761  {
762  /* is "left" */
763  d = amin - bmax;
764  }
765  else
766  {
767  /* is "right" */
768  assert( bmin > amax );
769  d = bmin - amax;
770  }
771 
772  return d;
773 }

Referenced by gserialized_distance_nd().

Here is the caller graph for this function: