城市明智的地理定位(正确的方式。)
我熟悉国家/地区的地理定位,但我想知道城市的地理定位,因为我正在查看一个网站,该网站将查看用户的 IP 并根据其城市(即主要城市,例如洛杉矶、纽约、孟买、伦敦等)。
分类可以基于人口或任何其他标准(对此有什么建议吗?)。
我了解 MaxMind 的服务,但他们是否针对城市?
你们能帮我解决这个问题,并提供一种方法来以简单的方式一步一步地完成这项工作吗?
非常感谢,这对我来说真的很有帮助。 问候,
I'm familiar with country-wise geo-targeting, but I was wondering about city-wise geo-targeting since I was looking at a site that would be looking at users' IPs and classifying them based on their city (i.e major cities like Los Angeles, New York, Mumbai, London, etc).
The classification could be based on the population or any other yardstick (any advice about this one?).
I know about MaxMind's services but do they target city-wise?
Can you guys help me out here and dish out a way to get this done, step by step in a simple way.
Thanks a lot, this will really help me out here.
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我强烈推荐 Spotter 地理定位服务。
它是免费的并且基于测量,因此您不会得到无意义的结果。
http://spotter.etomic.org/
I highly recommend the Spotter Geolocation Service.
It's free and measurement-based, so you won't get non-sense results.
http://spotter.etomic.org/
我们遇到了类似的问题,这是我们的解决方案:
我们使用 MaxMind City 数据库来确定国家/地区。我们确实信任它的 2 个字母国家代码。但我们不相信它的城市结果。
我们下载了 Maxmind 免费世界城市数据库,其中包含约 2,700,000 条记录
从这里:http://www.maxmind.com/app/worldcities
我分裂了将该数据库分成单独的文件,每个文件都以两个字母的国家/地区代码开头(例如“us.txt”、“fr.txt”、“it.txt”),并且该文件包含我们需要的任何数据,但显然是城市名称以及他们的局域网/纬度。)
我们提供一个自动完成的文本表单,并要求用户输入他的城市...
另一步可能是返回 MaxMind城市的结果,只需检查所选城市距离用户选择的位置不是 600 英里...但基本上,这就是我们选择为我们的一个社交网站实施的内容,我们需要或多或少地了解我们用户的精确位置。
We ran into a similar problem and here is our solution to this:
We use MaxMind City database, to determine the country. We do trust it for the 2 letter country codes. But we do not trust it for the city results.
We downloaded the Maxmind free world city database that contains about 2.700.000 records
from here: http://www.maxmind.com/app/worldcities
I splitted this database into separate files each one starts with the two letters country code (for example "us.txt", "fr.txt", "it.txt") and the file contains whatever data we need, but obviously name of the cities and their lan/lats.)
We provide a text form with auto-complete and ask the user to type in his city...
The other step could be to return to MaxMind City's results and just check that the chosen city is not 600 miles away from the location chosen by the user... But basically, this is what we chose to implement for one of our social sites, where we needed to know a more or less precise location of our users.