MaxMind:关联lat / lng的文件? [英] MaxMind: Correlating files for lat/lng?
问题描述
我从这里发现了MaxMind的City数据库:
http://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip
,其中不包含经度/纬度信息。该信息似乎在不同的文件中:
http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.zip
然而,当试图关联两个我发现细分代码不匹配。例如第一个文件包含以下行:
geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_name,subdivision_1_iso_code,subdivision_1_name,subdivision_2_iso_code,subdivision_2_name ,city_name,metro_code,time_zone
3369157,en,AF,Africa,ZA,南非,WC,西部省b $ b Cape, ,,开普敦,非洲/约翰内斯堡
从中可以看出开普敦的第一个政治分区是WC。然而,第二个文件提供了以下行:
locId,国家,地区,城市,邮政编码,纬度,经度,metroCode,areaCode
244,ZA,11,Cape Town,, - 33.9258,18.4232 ,,
从中可以看出区域是11而不是WC。
这样几个问题:
<1>如何关联这两个信息来源?
2)如果它们不能相互关联,是否还有其他文件我应该查看?
3)如果MaxMind提供的信息不一致,是否有更好的来源提供全球城市名称列表,提供地理位置信息?
TIA
经度和纬度位于GeoLite2块文件中,而不是位置文件。请参阅 GeoLite2 CSV文档。原因是坐标可能比位置文件中的(通常)城市级别位置更具体。
您链接到的另一个zip文件用于Legacy CSV,不适用于GeoLite2
I've downloaded the City database from MaxMind found here:
http://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip
which contains no latitude/longitude information. that information seems be in a different file:
http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.zip
however, when attempting to correlate the two I find that the subdivision codes do not match. for example the first file contains the line:
geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_name,subdivision_1_iso_code,subdivision_1_name,subdivision_2_iso_code,subdivision_2_name,city_name,metro_code,time_zone
3369157,en,AF,Africa,ZA,"South Africa",WC,"Province of the Western Cape",,,"Cape Town",,Africa/Johannesburg
from which one can see that the first political subdivision for Cape Town is WC. The second file, however, offers the line:
locId,country,region,city,postalCode,latitude,longitude,metroCode,areaCode 244,"ZA","11","Cape Town","",-33.9258,18.4232,,
from which it can be seen that the "region" is "11", not "WC".
so a few questions:
1) how do I correlate these two sources of information? 2) if they cannot be correlated, is there some other file I should be looking at? 3) if MaxMind offers no consistency in their information, is there a better source for a list of city names around the world that offers geolocation information?
TIA
The latitude and longitude are in the GeoLite2 blocks file, not the locations file. See the GeoLite2 CSV documentation. The reason for this is that coordinates may be more specific than the (generally) city-level locations in locations file.
The other zip file you link to is for the Legacy CSV and is not intended to be used with GeoLite2
这篇关于MaxMind:关联lat / lng的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!