silva 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/silva/system/gridref.rb +4 -4
- data/lib/silva/version.rb +1 -1
- data/test/test_gridref.rb +1 -1
- metadata +1 -1
data/lib/silva/system/gridref.rb
CHANGED
@@ -37,14 +37,14 @@ module Silva
|
|
37
37
|
#
|
38
38
|
def gridref
|
39
39
|
unless @gridref
|
40
|
-
e100k = (easting / 100000).floor
|
41
|
-
n100k = (northing / 100000).floor
|
40
|
+
e100k = (@easting / 100000).floor
|
41
|
+
n100k = (@northing / 100000).floor
|
42
42
|
|
43
43
|
index = n100k * OSGB_GRID_WIDTH + e100k
|
44
44
|
prefix = OSGB_PREFIXES[index]
|
45
45
|
|
46
|
-
e = ((easting % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
|
47
|
-
n = ((northing % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
|
46
|
+
e = ((@easting % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
|
47
|
+
n = ((@northing % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
|
48
48
|
|
49
49
|
@gridref = prefix + e.to_s.rjust(@digits / 2) + n.to_s.rjust(@digits / 2)
|
50
50
|
end
|
data/lib/silva/version.rb
CHANGED
data/test/test_gridref.rb
CHANGED