geokit / geokit-rails

Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem.
MIT License
1.57k stars 245 forks source link

no result #80

Closed Clempops closed 3 years ago

Clempops commented 9 years ago

The input:

Geokit::Geocoders::MultiGeocoder.geocode("90.51.160.250")

returns nil for each response input:

irb(main):002:0> res = Geokit::Geocoders::MultiGeocoder.geocode(ip)
Multi geocoding. address: 90.51.160.250, args []
Multi geocoding. address: 90.51.160.250, args []
GeoPlugin geocoding. address: 90.51.160.250, args []
GeoPlugin geocoding. address: 90.51.160.250, args []
GeoPlugin geocoding. Result: %3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3CgeoPlugin%3E%0A%09%3Cgeoplugin_request%3E90.51.160.250%3C%2Fgeoplugin_request%3E%0A%09%3Cgeoplugin_status%3E206%3C%2Fgeoplugin_status%3E%0A%09%3Cgeoplugin_credit%3ESome+of+the+returned+data+includes+GeoLite+data+created+by+MaxMind%2C+available+from+%26lt%3Ba+href%3D%5C%27http%3A%2F%2Fwww.maxmind.com%5C%27%26gt%3Bhttp%3A%2F%2Fwww.maxmind.com%26lt%3B%2Fa%26gt%3B.%3C%2Fgeoplugin_credit%3E%0A%09%3Cgeoplugin_city%3E%3C%2Fgeoplugin_city%3E%0A%09%3Cgeoplugin_region%3E%3C%2Fgeoplugin_region%3E%0A%09%3Cgeoplugin_areaCode%3E0%3C%2Fgeoplugin_areaCode%3E%0A%09%3Cgeoplugin_dmaCode%3E0%3C%2Fgeoplugin_dmaCode%3E%0A%09%3Cgeoplugin_countryCode%3EFR%3C%2Fgeoplugin_countryCode%3E%0A%09%3Cgeoplugin_countryName%3EFrance%3C%2Fgeoplugin_countryName%3E%0A%09%3Cgeoplugin_continentCode%3EEU%3C%2Fgeoplugin_continentCode%3E%0A%09%3Cgeoplugin_latitude%3E48.860001%3C%2Fgeoplugin_latitude%3E%0A%09%3Cgeoplugin_longitude%3E2.35%3C%2Fgeoplugin_longitude%3E%0A%09%3Cgeoplugin_regionCode%3E%3C%2Fgeoplugin_regionCode%3E%0A%09%3Cgeoplugin_regionName%2F%3E%0A%09%3Cgeoplugin_currencyCode%3EEUR%3C%2Fgeoplugin_currencyCode%3E%0A%09%3Cgeoplugin_currencySymbol%3E%26amp%3B%238364%3B%3C%2Fgeoplugin_currencySymbol%3E%0A%09%3Cgeoplugin_currencySymbol_UTF8%3E%E2%82%AC%3C%2Fgeoplugin_currencySymbol_UTF8%3E%0A%09%3Cgeoplugin_currencyConverter%3E0.8893%3C%2Fgeoplugin_currencyConverter%3E%0A%3C%2FgeoPlugin%3E%0A
GeoPlugin geocoding. Result: %3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3CgeoPlugin%3E%0A%09%3Cgeoplugin_request%3E90.51.160.250%3C%2Fgeoplugin_request%3E%0A%09%3Cgeoplugin_status%3E206%3C%2Fgeoplugin_status%3E%0A%09%3Cgeoplugin_credit%3ESome+of+the+returned+data+includes+GeoLite+data+created+by+MaxMind%2C+available+from+%26lt%3Ba+href%3D%5C%27http%3A%2F%2Fwww.maxmind.com%5C%27%26gt%3Bhttp%3A%2F%2Fwww.maxmind.com%26lt%3B%2Fa%26gt%3B.%3C%2Fgeoplugin_credit%3E%0A%09%3Cgeoplugin_city%3E%3C%2Fgeoplugin_city%3E%0A%09%3Cgeoplugin_region%3E%3C%2Fgeoplugin_region%3E%0A%09%3Cgeoplugin_areaCode%3E0%3C%2Fgeoplugin_areaCode%3E%0A%09%3Cgeoplugin_dmaCode%3E0%3C%2Fgeoplugin_dmaCode%3E%0A%09%3Cgeoplugin_countryCode%3EFR%3C%2Fgeoplugin_countryCode%3E%0A%09%3Cgeoplugin_countryName%3EFrance%3C%2Fgeoplugin_countryName%3E%0A%09%3Cgeoplugin_continentCode%3EEU%3C%2Fgeoplugin_continentCode%3E%0A%09%3Cgeoplugin_latitude%3E48.860001%3C%2Fgeoplugin_latitude%3E%0A%09%3Cgeoplugin_longitude%3E2.35%3C%2Fgeoplugin_longitude%3E%0A%09%3Cgeoplugin_regionCode%3E%3C%2Fgeoplugin_regionCode%3E%0A%09%3Cgeoplugin_regionName%2F%3E%0A%09%3Cgeoplugin_currencyCode%3EEUR%3C%2Fgeoplugin_currencyCode%3E%0A%09%3Cgeoplugin_currencySymbol%3E%26amp%3B%238364%3B%3C%2Fgeoplugin_currencySymbol%3E%0A%09%3Cgeoplugin_currencySymbol_UTF8%3E%E2%82%AC%3C%2Fgeoplugin_currencySymbol_UTF8%3E%0A%09%3Cgeoplugin_currencyConverter%3E0.8893%3C%2Fgeoplugin_currencyConverter%3E%0A%3C%2FgeoPlugin%3E%0A
Ip geocoding. address: 90.51.160.250, args []
Ip geocoding. address: 90.51.160.250, args []
Ip geocoding. Result: Country%3A+%28Unknown+Country%3F%29+%28XX%29%0ACity%3A+%28Unknown+City%3F%29%0A%0ALatitude%3A+%0ALongitude%3A+%0AIP%3A+90.51.160.250%0A
Ip geocoding. Result: Country%3A+%28Unknown+Country%3F%29+%28XX%29%0ACity%3A+%28Unknown+City%3F%29%0A%0ALatitude%3A+%0ALongitude%3A+%0AIP%3A+90.51.160.250%0A
=> #<Geokit::GeoLoc:0x007fcdb538ec00 @all=[#<Geokit::GeoLoc:0x007fcdb538ec00 ...>], @street_address=nil, @sub_premise=nil, @street_number=nil, @street_name=nil, @city=nil, @state=nil, @state_code=nil, @state_name=nil, @zip=nil, @country_code=nil, @province=nil, @success=false, @precision="unknown", @full_address=nil, @lat=nil, @lng=nil>

Is there any solution?

ryankopf commented 3 years ago

This could simply be that the data providers do not have any data for this IP address, which is out of the scope of what can be fixed by this project.