PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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:94
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:93
#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.