5
5
6
6
public class LatLngBoundsUtils {
7
7
public static boolean BoundsAreDifferent (BoundingBox a , BoundingBox b ) {
8
- GeoPoint centerA = a .getCenter ();
8
+ GeoPoint centerA = a .getCenterWithDateLine ();
9
9
double latA = centerA .getLatitude ();
10
10
double lngA = centerA .getLongitude ();
11
11
double latDeltaA = a .getLatitudeSpan ();
12
- double lngDeltaA = a .getLongitudeSpan ();
12
+ double lngDeltaA = a .getLongitudeSpanWithDateLine ();
13
13
14
- GeoPoint centerB = b .getCenter ();
14
+ GeoPoint centerB = b .getCenterWithDateLine ();
15
15
double latB = centerB .getLatitude ();
16
16
double lngB = centerB .getLongitude ();
17
17
double latDeltaB = b .getLatitudeSpan ();
18
- double lngDeltaB = b .getLongitudeSpan ();
18
+ double lngDeltaB = b .getLongitudeSpanWithDateLine ();
19
19
20
20
double latEps = LatitudeEpsilon (a , b );
21
21
double lngEps = LongitudeEpsilon (a , b );
@@ -39,8 +39,8 @@ private static double LatitudeEpsilon(BoundingBox a, BoundingBox b) {
39
39
}
40
40
41
41
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 ();
44
44
double size = Math .min (Math .abs (sizeA ), Math .abs (sizeB ));
45
45
return size / 2560 ;
46
46
}
0 commit comments