]> git.openstreetmap.org Git - rails.git/blobdiff - lib/quad_tile.rb
Make sure the ruby quadtile code give the same result as the C version
[rails.git] / lib / quad_tile.rb
index 6e4fb6d2248c243bfc15c245fa0e643501229abf..a818f6a27f28cae18dd25cc3b287a1bc5eb38912 100644 (file)
@@ -3,8 +3,8 @@ module QuadTile
     require "quad_tile/quad_tile_so"
   rescue MissingSourceFile
     def self.tile_for_point(lat, lon)
-      x = ((lon + 180) * 65535 / 360).round
-      y = ((lat + 90) * 65535 / 180).round
+      x = ((lon.to_f + 180) * 65535 / 360).round
+      y = ((lat.to_f + 90) * 65535 / 180).round
 
       return tile_for_xy(x, y)
     end