MaxMind:关联 lat/lng 的文件?

MaxMind: Correlating files for lat/lng?

我已经从此处找到的 MaxMind 下载了 City 数据库:

http://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip

其中不包含 latitude/longitude 信息。该信息似乎在不同的文件中:

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,"South Africa",WC,"Province of the Western Cape",,,"Cape Town",,Africa/Johannesburg

从中可以看出开普敦的第一个政治分区是WC。但是,第二个文件提供了以下行:

locId,country,region,city,postalCode,latitude,longitude,metroCode,areaCode 244,"ZA","11","Cape Town","",-33.9258,18.4232,,

从中可以看出"region"是“11”,而不是"WC"。

所以几个问题:

1) 如何关联这两个信息源? 2)如果它们不能关联,我应该查看其他文件吗? 3) 如果 MaxMind 提供的信息不一致,是否有更好的来源来获取提供地理位置信息的世界各地城市名称列表?

TIA

纬度和经度位于 GeoLite2 块文件中,而不是位置文件中。见GeoLite2 CSV documentation。这样做的原因是坐标可能比位置文件中的(通常)城市级位置更具体。

您 link 使用的另一个 zip 文件是旧 CSV 文件,不适用于 GeoLite2