PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ crosses_dateline()

int crosses_dateline ( const GEOGRAPHIC_POINT s,
const GEOGRAPHIC_POINT e 
)

Definition at line 666 of file lwgeodetic.c.

667 {
668  double sign_s = SIGNUM(s->lon);
669  double sign_e = SIGNUM(e->lon);
670  double ss = fabs(s->lon);
671  double ee = fabs(e->lon);
672  if ( sign_s == sign_e )
673  {
674  return LW_FALSE;
675  }
676  else
677  {
678  double dl = ss + ee;
679  if ( dl < M_PI )
680  return LW_FALSE;
681  else if ( FP_EQUALS(dl, M_PI) )
682  return LW_FALSE;
683  else
684  return LW_TRUE;
685  }
686 }
char * s
Definition: cu_in_wkt.c:23
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
#define SIGNUM(n)
Macro that returns: -1 if n < 0, 1 if n > 0, 0 if n == 0.
#define FP_EQUALS(A, B)

References FP_EQUALS, GEOGRAPHIC_POINT::lon, LW_FALSE, LW_TRUE, s, and SIGNUM.

Referenced by ptarray_area_spheroid().

Here is the caller graph for this function: