PostGIS  2.1.10dev-r@@SVN_REVISION@@
int crosses_dateline ( const GEOGRAPHIC_POINT s,
const GEOGRAPHIC_POINT e 
)

Definition at line 615 of file lwgeodetic.c.

References FP_EQUALS, GEOGRAPHIC_POINT::lon, LW_FALSE, LW_TRUE, and signum.

Referenced by ptarray_area_spheroid().

616 {
617  double sign_s = signum(s->lon);
618  double sign_e = signum(e->lon);
619  double ss = fabs(s->lon);
620  double ee = fabs(e->lon);
621  if ( sign_s == sign_e )
622  {
623  return LW_FALSE;
624  }
625  else
626  {
627  double dl = ss + ee;
628  if ( dl < M_PI )
629  return LW_FALSE;
630  else if ( FP_EQUALS(dl, M_PI) )
631  return LW_FALSE;
632  else
633  return LW_TRUE;
634  }
635 }
#define signum(a)
Ape a java function.
Definition: lwgeodetic.h:66
#define LW_FALSE
Definition: liblwgeom.h:52
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
#define FP_EQUALS(A, B)

Here is the caller graph for this function: