mteodoro / mmutils

Tools for working with MaxMind GeoIP csv and dat files
MIT License
95 stars 47 forks source link

Wrong values after build .dat #17

Open iglov opened 6 years ago

iglov commented 6 years ago

Hi there! Maybe i'll lucky and someone can help me with this deprecated project. I try to build geolitecity from csv (Source: GeoLiteCity-flat-sorted.csv.zip) with csv2dat.py -w GeoLiteCity.dat mmcity GeoLiteCity-flat-sorted.csv. When i done, i check it with, for example, ip 191.243.53.129 . In debug file (when we use csv2dat.py with -d key) i see:

2148767 ["14702888 (('BR', 'Parana', 'Ampere', '', '-25.9167', '-53.4667', '', '20'), IPv4Network('191.243.48.0/22'))", "17135708 (('BR', 'Santa Catarina', 'Abelardo Luz', '89830', '-26.5983', '-52.2232', '', '50'), IPv4Network('191.243.52.0/22'))"]
2148768 ["16892194 (('BR', 'Minas Gerais', 'Pompeu', '35640', '-19.1495', '-44.9149', '', '10'), IPv4Network('191.243.56.0/22'))", 2148769]

BUT when i ask my GeoLiteCity.dat file "tell me, who is 191.243.53.129" with python (pygeoip, GeoIP modules) or geoiplookup i got: US, Pennsylvania, N/A, Philadelphia, 19123, 39.964298, -75.144402, 504, 500 So, maybe someone can explain me, why it done? Why info in .dat file is wrong? And how fix it? P.S. I'm desperate