55
66public class LatLngBoundsUtils {
77 public static boolean BoundsAreDifferent (BoundingBox a , BoundingBox b ) {
8- GeoPoint centerA = a .getCenter ();
8+ GeoPoint centerA = a .getCenterWithDateLine ();
99 double latA = centerA .getLatitude ();
1010 double lngA = centerA .getLongitude ();
1111 double latDeltaA = a .getLatitudeSpan ();
12- double lngDeltaA = a .getLongitudeSpan ();
12+ double lngDeltaA = a .getLongitudeSpanWithDateLine ();
1313
14- GeoPoint centerB = b .getCenter ();
14+ GeoPoint centerB = b .getCenterWithDateLine ();
1515 double latB = centerB .getLatitude ();
1616 double lngB = centerB .getLongitude ();
1717 double latDeltaB = b .getLatitudeSpan ();
18- double lngDeltaB = b .getLongitudeSpan ();
18+ double lngDeltaB = b .getLongitudeSpanWithDateLine ();
1919
2020 double latEps = LatitudeEpsilon (a , b );
2121 double lngEps = LongitudeEpsilon (a , b );
@@ -39,8 +39,8 @@ private static double LatitudeEpsilon(BoundingBox a, BoundingBox b) {
3939 }
4040
4141 private static double LongitudeEpsilon (BoundingBox a , BoundingBox b ) {
42- double sizeA = a .getLongitudeSpan ();
43- double sizeB = b .getLongitudeSpan ();
42+ double sizeA = a .getLongitudeSpanWithDateLine ();
43+ double sizeB = b .getLongitudeSpanWithDateLine ();
4444 double size = Math .min (Math .abs (sizeA ), Math .abs (sizeB ));
4545 return size / 2560 ;
4646 }
0 commit comments