Created
May 10, 2010 08:19
-
-
Save mort/395808 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'csquares' | |
require 'geohash' | |
class TileMaker | |
def self.make(lat_min = 0.0, lon_min = 0.0, lat_max = 90.0, lon_max = 180.0, step = 0.0001) | |
lat = lat_min | |
lon = lon_min | |
[1.0,-1.0].each do |m| | |
lat = lat*m | |
lon = lon*m | |
while lat < lat_max | |
while lon < lon_max | |
csquare = CSquare.new(lat,lon) | |
geohash = GeoHash.encode(lat,lon) | |
puts "#{lat},#{lon}, #{csquare.code}, #{geohash}" | |
lon = lon + step | |
end | |
lat = lat + step | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment