在生产服务器上使用地理编码器
我正在开发一个基于位置的应用程序。我需要一个可靠的来源来获取地理定位。
现在我正在使用这个 geocoder 插件。
我收到此错误:-
Geocoding API not responding fast enough (see Geocoder::Configuration.timeout to set limit).
当我们的 5 人团队在临时服务器上进行测试时,我收到错误
我需要一个足够快的解决方案,每天大约 10k 请求,没有每秒限制
PS:我愿意使用一些付费服务。
编辑
想象一下您想要在纽约搜索某些内容的情况。在文本框中输入 newyork 并按 Enter 键。现在在服务器端,我需要获取纽约的地理编码,然后根据该信息在数据库中进行搜索。
I am developing a location based application. And i need a trustable source for getting geolocation.
right now i am using this geocoder plugin.
and i am getting this error:-
Geocoding API not responding fast enough (see Geocoder::Configuration.timeout to set limit).
I am getting error when our team of 5 is testing on staging servers
I need a fast enough solution with some ~10k request a day with no per second limits
PS: I am open to use some paid service.
EDIT
Think of a case you want to search something in NewYork. In textbox you will type newyork and press enter. Now on server side I need to fetch geocode for newyork and then search in db based upon that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该对客户端进行地理编码(在 JavaScript 中),这样您就不会受到限制:
http://code.google.com/apis/maps/articles/geocodestrat.html
You should geocode client side (in javascript) you won't be hit by the limits :
http://code.google.com/apis/maps/articles/geocodestrat.html
任何基于网络的服务都可能会发生这种情况。您可能需要考虑将这些任务发送到后台作业管理器(例如 Resque 或 Delayed Job),该管理器将重试失败的作业,而不会中断用户。它们还使您的应用程序看起来更快,因为您的用户不必等待第三方(可能是间歇性的)Web 应用程序响应。
This is probably bound to happen with any web based service. You might want to consider sending these tasks to a background job manager (such as Resque or Delayed Job) which will retry failed jobs without disrupting users. They also make your application seem faster since your user will not have to wait for third party (and possibly intermittent) web applications to respond.
尝试使用 maxmind.com - 这将根据 IP 地址进行地理查找。他们有一个免费或付费的数据库,您可以将其存储在您的服务器上。他们有一个 Ruby API。我在生产系统中使用它,并且当数据被缓存时,查找通常是亚毫秒级的。
Try using maxmind.com - this will do a geo lookup based on IP address. They have a free or paid for database that your store on your server. They have a Ruby API. I use this in a production system and the lookups are typically sub-millisecond as the data is cached.