I want to convert two IPv4 addresses to latitude and longitude, then calculate the geographical distance between them.
Geokit says it can do this.
Seattle:
a = Geokit::Geocoders::GoogleGeocoder.geocode("207.244.147.34")
a.lat => 37.0483944, a.lng => 37.3421261 (should be 47.5839, -122.2995)
Edit: Okay below is an IP address for UK not SF, but its still UK not Turkey.
San Francisco:
b = Geokit::Geocoders::GoogleGeocoder.geocode("5.68.123.155")
a.lat => 14.6478672, a.lng => 120.9880659 (should be 37.7691, -122.4449)
a.distance_to(b)
returns 5273.737623217472.
So apparently Seattle to San Fransisco is bit over 5000 miles and I am getting a great deal on airfare.
What am I missing?