Closed madshargreave closed 8 years ago
Sorry for the confusion regarding the name
fields of the results.
Up until now there was no default locale in place if you did not pass one explicitly to Geolix.lookup/2
.
If have released version v0.10.1
to hex with a changed and hopefully more intuitive behaviour (should also be more in line with other mmdb2 libraries). With that update you should always get the english result names by default when not passing a locale.
Thank you for bringing this up :+1:
Cool, thanks for the quick response
However, the city
is still nil
Any ideas?
Can you share the IP you are looking up?
Just testing various random IPs always gives me a proper result for the city. You might have found an entry that does not have any city data while being in the city database...
I am trying with
Geolix.lookup "130.226.239.132"
You're right, I tried with some other ones and I did find a city, but inspecting the CSV database, I do find entries for the city I am in and also nearby cities
I just did a check with the most current free database and the official python library:
>>> import geoip2.database
>>> city = geoip2.database.Reader('./GeoLite2-City.mmdb')
>>> city.city("130.226.239.132").city
geoip2.records.City(geoname_id=None, confidence=None, _locales=['en'], names={})
RIPE says it is registered to a university. Those IP ranges are sometimes just like company associated ranges just not mapped to any particular city. Paid databases and the official webservice API (check the input on the MaxMind website) may always give better results.
Ah I see
I was just looking at http://dev.maxmind.com/geoip/geoip2/javascript/
There's a response with the exact same IP, and it also returns the city and subdivisions. I wasn't aware that data was more limited on the downloaded database, compared to the online webservice
Anyway, thanks for the heads up
Hi
I have downloaded the mmdb database from here
https://dev.maxmind.com/geoip/geoip2/geolite2/
And I use
Geolix.set_database(:city, "city.mmdb.gz") \\ :ok
to set the path.However, I get the following results (note how the
name
field for both country and city is missing)