Created
October 18, 2009 08:48
-
-
Save masuidrive/212597 to your computer and use it in GitHub Desktop.
東京付近のGeoHashの精度
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
=begin | |
東京付近のGeoHashの精度 | |
|文字数| 南北 | 東西 | | |
| 6| 609.08m| 988.77m| | |
| 7| 152.27m| 123.60m| | |
| 8| 19.03m| 30.90m| | |
| 9| 4.76m| 3.86m| | |
| 10| 0.59m| 0.97m| | |
=end | |
puts (6..10).map {|i| | |
lng_bit = (5 * i / 2.0).ceil | |
lat_bit = (5 * i / 2.0).floor | |
lng_grid_size = sprintf("%6.2fm", (360.0 / (2 ** lng_bit))*(25.0*60*60)) | |
lat_grid_size = sprintf("%6.2fm", (180.0 / (2 ** lat_bit))*(30.8*60*60)) | |
[i, lat_bit, lng_bit, lat_grid_size, lng_grid_size] | |
}.map{|r| "|#{r.join('|')}|"}.join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment