Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最近我偶然发现了一个问题——MaxMind 的 GeoIPCity 文件对于我们的需求来说太大了,并且包含很多我们不需要也不需要的数据。
问题是:有没有办法将城市数据库限制在一个国家?比方说,只有加拿大城市?
您不能只方便地下载加拿大城市的数据库,但您当然可以在下载并加载数据库后对其进行修剪。无论您使用 MaxMind DB 还是下载 CSV 格式都是如此,只需剪掉不代表加拿大国家代码或 geoname_id 的行(取决于数据集的 v1 或 v2)。
如果您确定了您的特定编码环境和语言,我敢肯定有人可以帮助您编写几行代码来消除所有脂肪。