像 Groupon 这样的网站如何根据其进行交易的城市来进行地理定位?
假设您从加利福尼亚州阿古拉山 (Agoura Hills) 的入口点访问 Groupon - Groupon 将如何将该城镇引用到最近有优惠的城市(例如洛杉矶)并选择该城市作为最近的城市?
它是否从该位置获取纬度/经度并计算与所有可用城市的距离,选择最短的?如果是这样,您可以在哪里获取每个城市的纬度/经度数据或用于此目的的开放 API?
Say you visit Groupon from the entry point Agoura Hills, CA - how would Groupon go about referencing that town to the nearest city that has deals (like Los Angeles) and choosing that as the closest?
Is it grabbing lat/long from the location and calculating the distance from all available cities, choosing the shortest? If so, where can you get lat/long data like that for each city or an open api to use for this purpose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Groupon 似乎使用 Limelightnetworks 作为他们的 CDN 提供商,并且大多数 CDN 由于其分布式特性而拥有某种地理位置数据库,可以映射来自该地区的请求。在 CDN 手中,这些信息很容易,并且站点可以进一步使用该信息。
DNS 所需要的只是以某种方式通知服务器,这并不是一个新概念。
还有一个 地理定位 API 规范,它允许浏览器/客户端将有关用户位置的信息发送到服务器(服务器可以使用该信息进行自定义)。这些因素会影响 DNS、无线 AP 等因素。但这仍处于草案阶段,一些谷歌服务使用它,并且也需要浏览器支持。
Groupon seems to use limelightnetworks as their CDN provider and most CDNs due to their distributed nature having some kind of geo-location database which they can map the request which is coming from the region. At the CDN's hands those information is easy, and site can be work with that information further.
All that would be required is someway for the DNS to inform the server and this is not a new concept.
There is a also a geolocation API spec, which would allow browsers/clients to send information about the users location to the server (which the server can use for customization). Those act number of factors such as DNS, your wireless AP, etc. But that is still in draft stage and some google services use it and it requires browser support too.