lib/geolookup/country.rb in geolookup-0.3.0 vs lib/geolookup/country.rb in geolookup-0.5.0
- old
+ new
@@ -1,10 +1,10 @@
# encoding: UTF-8
#################################################################
# Geocode::TigerLine::Fips
#
-# This module contains all the state and country lat longs,
+# This module contains all the state and country lat longs,
# display names too
#
module Geolookup
module Country
@@ -15,14 +15,18 @@
def self.code_to_name(country_code)
CODE_TO_NAME[country_code.to_s.upcase]
end
- def self.lat_long(country_name)
+ #def self.code_to_lat_long(country_code)
+ # LAT_LONG[country_code.to_s.upcase]
+ #end
+
+ def self.name_to_lat_long(country_name)
LAT_LONG[country_name.to_s.upcase]
end
-
+
NAME_TO_CODE = {
"AFGHANISTAN" => "AF",
"ALBANIA" => "AL",
"ALGERIA" => "DZ",
"AMERICAN SAMOA" => "AS",
@@ -289,11 +293,11 @@
"WESTERN SAHARA" => "EH",
"YEMEN" => "YE",
"ZAMBIA" => "ZM",
"ZIMBABWE" => "ZW",
}
-
+
CODE_TO_NAME = {
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
@@ -535,11 +539,11 @@
"EH" => "Western Sahara",
"YE" => "Yemen",
"ZM" => "Zambia",
"ZW" => "Zimbabwe",
}
-
+
LAT_LONG = {
"AFGHANISTAN" => [ 33000000, 65000000 ],
"ALBANIA" => [ 41000000, 20000000 ],
"ALGERIA" => [ 28000000, 3000000 ],
"AMERICAN SAMOA" => [ -14333300, -170000000 ],
@@ -807,8 +811,8 @@
"WESTERN SAHARA" => [ 24500000, -13000000 ],
"YEMEN" => [ 15000000, 48000000 ],
"ZAMBIA" => [ -15000000, 30000000 ],
"ZIMBABWE" => [ -20000000, 30000000 ],
}
-
+
end
end
\ No newline at end of file