ruby-on-rails - 在生产服务器上使用地理编码器

标签 ruby-on-rails geolocation geocoding

我正在开发一个基于位置的应用程序。我需要一个可靠的来源来获取地理定位。
现在我正在使用这个 geocoder 插件。
我收到此错误:-

Geocoding API not responding fast enough (see Geocoder::Configuration.timeout to set limit).
当我们的 5 人团队在临时服务器上进行测试时出现错误
我需要一个足够快的解决方案,每天有大约 1 万个请求,没有每秒限制
PS:我愿意使用一些付费服务。
编辑
想一想您想在纽约搜索某些内容的案例。在文本框中,您将输入 newyork 并按 Enter。现在在服务器端,我需要为 newyork 获取地理编码,然后根据它在 db 中搜索。

最佳答案

您应该对客户端(在 javascript 中)进行地理编码,您不会受到限制:

Server-side geocoding, through the Geocoding Web Service has a quota of 2,500 requests per IP per day, so all requests in one day count against the quota. In addition, the Web Service is rate-limited, so that requests that come in too quickly result in blocking. Client-side geocoding through the browser is rate limited per map session, so the geocoding is distributed across all your users and scales with your userbase. Geocoding quotas and rate limits drive the strategies outlined in this article.

When to Use Client-Side Geocoding

The basic answer is "almost always". As geocoding limits are per IP address, that limit counts against the consumer of your application. It's going to be very rare that someone is going to enter more than 2,500 addresses a day sitting at their computer. Therefore, running client-side geocoding, you generally don't have to worry about your quota.


http://code.google.com/apis/maps/articles/geocodestrat.html

关于ruby-on-rails - 在生产服务器上使用地理编码器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6451099/

相关文章:

css - Rails : Stylesheet/view issue? 虽然在浏览器中查看时有源代码,但屏幕上没有显示任何内容

ruby-on-rails - 以随机顺序将每条记录显示为新页面

r - 如何保留空间特征的唯一交集并删除边界外的所有内容?

javascript - 从带有传单的地址获取纬度和经度

r - 为 GoogleMap 绘图添加透明度(loa 包)

ruby-on-rails - Rails 测试单元 - content_for 的助手

ruby-on-rails - 如何设置多层 Rails ActiveRecord 多对多关系?

iphone - 如何从 iPhone 核心位置获取当前(美国)状态?

javascript - 通过 LAT LONG 的 OpenWeatherMap API 地理定位无法正常工作或无法打印

c# - Mongodb:如何检查一个点是否包含在多边形中?