geo_monitor 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geo_monitor/bounding_box.rb +3 -3
- data/lib/geo_monitor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aa59e208f3d1d09a9756f3c478478fc5aa21bd2
|
4
|
+
data.tar.gz: 65df4b3d90e6c9df548f7ea539ffbd092e5c8704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1034ba899f4974e949b2e027e55b070fff277d655e64010130832e5bb08e534880ed17e951391a64e41768ea2f7d358ee8eb53222a60b2b0f00dd34623897ae3
|
7
|
+
data.tar.gz: 3da4e76a03b327e3cc795954f636a28e194338dd639f58f95fab088081431958ce98d77ef44e2aa61823d54d0639a1eac02281f2feab038c62c8dfb28f2ace64
|
@@ -38,10 +38,10 @@ module GeoMonitor
|
|
38
38
|
lng_diff = east - west
|
39
39
|
max_diff = [lat_diff, lng_diff].max
|
40
40
|
|
41
|
-
if max_diff < GeoMonitor::DEGREES_IN_CIRCLE / 2**20
|
41
|
+
if max_diff < ::GeoMonitor::DEGREES_IN_CIRCLE / 2**20
|
42
42
|
zoom = 21
|
43
43
|
else
|
44
|
-
zoom = -1 * ((Math.log(max_diff) / Math.log(2)) - (Math.log(GeoMonitor::DEGREES_IN_CIRCLE) / Math.log(2)))
|
44
|
+
zoom = -1 * ((Math.log(max_diff) / Math.log(2)) - (Math.log(::GeoMonitor::DEGREES_IN_CIRCLE) / Math.log(2)))
|
45
45
|
zoom = 1 if zoom < 1
|
46
46
|
end
|
47
47
|
zoom.ceil
|
@@ -52,7 +52,7 @@ module GeoMonitor
|
|
52
52
|
def tile_number
|
53
53
|
lat_rad = south / 180 * Math::PI
|
54
54
|
n = 2.0**zoom_level
|
55
|
-
x = ((west + 180.0) / GeoMonitor::DEGREES_IN_CIRCLE * n).to_i
|
55
|
+
x = ((west + 180.0) / ::GeoMonitor::DEGREES_IN_CIRCLE * n).to_i
|
56
56
|
y = ((1.0 - Math.log(Math.tan(lat_rad) + (1 / Math.cos(lat_rad))) / Math::PI) / 2.0 * n)
|
57
57
|
y = if y.infinite?.nil?
|
58
58
|
y.to_i
|
data/lib/geo_monitor/version.rb
CHANGED