简体   繁体   English

Google Directions API限制

[英]Google Directions API limit

i am trying to draw the route between two markers on my google map which i implement in my android app. 我想在我的谷歌地图上绘制两个标记之间的路线,我在我的Android应用程序中实现。 I have read, the way to do this is invoking the Directions API service. 我已经读过,这样做的方法是调用Directions API服务。 The Usage Limits says you could only make 2500 request per day, i am confuse about that, this limit will apply for my whole app traffic (all the users would be able to made 2500 total request) or apply for individual mobile devices (a single app instance running on a single device would be able to make 2500 request per day). 使用限制表示您每天只能发出2500个请求,我很困惑,此限制将适用于我的整个应用流量(所有用户可以提出2500个请求)或申请个人移动设备(单个在单个设备上运行的app实例每天可以发出2500个请求。 I have found many questions about this topic but none official answer. 我发现了很多关于这个主题的问题,但没有官方回答。 I appreciate any help Thanks. 我感谢任何帮助谢谢。

I believe this is the answer you are looking for (from google developer section): 我相信这是您正在寻找的答案(来自谷歌开发者部分):

https://developers.google.com/maps/articles/geocodestrat https://developers.google.com/maps/articles/geocodestrat

Quota Considerations 配额考虑因素

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. 通过地理编码Web服务进行的服务器端地理编码每天每个IP的配额为2,500个,因此一天内的所有请求都会计入配额。 In addition, the Web Service is rate-limited, so that requests that come in too quickly result in blocking. 此外,Web Service受速率限制,因此进入过快的请求会导致阻塞。 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 user session, there is no risk that your application will reach a global limit as your userbase grows. 由于地理编码限制是按用户会话进行的,因此随着用户群的增长,您的应用程序不会有达到全局限制的风险。 Client-side geocoding will not face a quota limit unless you perform a batch of geocoding requests within a user session. 除非您在用户会话中执行一批地理编码请求,否则客户端地理编码不会面临配额限制。 Therefore, running client-side geocoding, you generally don't have to worry about your quota. 因此,运行客户端地理编码时,通常不必担心配额。

Two basic architectures for client-side geocoding exist. 存在两种用于客户端地理编码的基本体系结构。 •Run the geocoding and display entirely in the browser. •完全在浏览器中运行地理编码和显示。 For instance, the user enters an address on your page. 例如,用户在您的页面上输入地址。 Your application geocodes it. 您的应用程序对其进行了编码 Then your page uses the geocode to create a marker on the map. 然后您的页面使用地理编码在地图上创建标记。 Or your app does some simple analysis using the geocode. 或者您的应用程序使用地理编码进行一些简单的分析。 No data is sent to your server. 没有数据发送到您的服务器。 This reduces load on your server, but doesn't give you any sense of what your users are doing. 这样可以减少服务器的负载,但不会让您了解用户的操作。

•Run the geocode in the browser and then send it to the server. •在浏览器中运行地理编码,然后将其发送到服务器。 For instance, the user enters an address. 例如,用户输入地址。 Your application geocodes it in the browser. 您的应用程序在浏览器中对其进行地理编码。 The app then sends the data to your server. 然后,应用程序将数据发送到您的服务器。 The server responds with some data, such as nearby points of interest. 服务器响应一些数据,例如附近的兴趣点。 This allows you to customize a response based on your own data, and also to cache the geocode if you want. 这允许您根据自己的数据自定义响应,并根据需要缓存地理编码。 This cache allows you to optimize even more. 此缓存允许您进行更多优化。 You can even query the server with the address, see if you have a recently cached geocode for it, and if you do, use that. 您甚至可以使用地址查询服务器,看看您是否有最近缓存的地理编码,如果有,请使用它。 If you don't, then return no result to the browser, and let it geocode the result and send it back to the server to for caching. 如果不这样做,则不向浏览器返回任何结果,并让结果对结果进行地理编码并将其发送回服务器以进行缓存。

UPDATE 03/23/2015: per request by a poster 更新03/23/2015:根据海报的要求

Here is the excerpt from the Google documentation on quota limits for the direction API: 以下是Google文档中有关方向API配额限制的摘录:

Usage Limits 使用限制

The Directions API has the following limits in place: Users of the free API:•2,500 directions requests per 24 hour period. Directions API具有以下限制:免费API的用户:•每24小时2,500个路线请求。
•Up to 8 waypoints allowed in each request. •每个请求中最多允许8个航路点。 Waypoints are not available for transit directions. 航路点不适用于公交路线。
•2 requests per second. •每秒2次请求。 Google Maps API for Work customers:•100,000 directions requests per 24 hour period. Google Maps API for Work客户:•每24小时有100,000个路线请求。
•23 waypoints allowed in each request. •每个请求允许23个航路点。 Waypoints are not available for transit directions. 航路点不适用于公交路线。
•10 requests per second. •每秒10个请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM