开发者

Parsing XML With Google Maps Directions API fails [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about programming within the scope defined in the help center.

Closed 4 years ago.

Improve this ques开发者_运维百科tion

first of all, actually I have a problem in Android programming but maybe I should describe the case..

I want to make Android application which can show the distance between two locations based on their latitude and longitude.. I store those coordinates in my SQLite database..

To determine the distance, I use Google Maps API Direction and parse it with XML Parser since the result I want in XML format. It works fine in my emulator and real device. But, after several days, it shows the null result and I don't know why since my code doesn't show any error.

Then, I try to throw the instruction in http://code.google.com/apis/maps/documentation/directions/

And I try this: http://maps.googleapis.com/maps/api/directions/xml?origin=-7.966071,112.60774&destination=-7.963988,112.607487&sensor=false&units=metric

The result is in XML format, but it shows:

> <DirectionsResponse> <status>OVER_QUERY_LIMIT</status>
> </DirectionsResponse>

So, I read again and find this:

Usage Limits

Use of the Google Directions API is subject to a query limit of 2,500 directions requests per day. Individual directions requests may contain up to 8 intermediate waypoints in the request. Google Maps Premier customers may query up to 100,000 directions requests per day, with up to 23 waypoints allowed in each request.

Additionally, note that Directions API URLs are restricted to 2048 characters, before URL Encoding. As some Directions service URLs may involve many locations along a path, be aware of this limit when constructing your URLs.

Note: the Directions API may only be used in conjunction with displaying results on a Google map; using Directions data without displaying a map for which directions data was requested is prohibited. Additionally, calculation of directions generates copyrights and warnings which must be displayed to the user in some fashion. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.

Is it any relationship between those??? I tried many times and got nothing..

So, is there any 'limitations' to use API Directions??


Google Maps detects automated query request and blocks them. Perhaps your application behaved in such a way. (Behaviour like requesting for directions after fixed intervals of time. Or too many queries per second)

This limit is enforced to prevent abuse and/or repurposing of the Geocoding API, and this limit may be changed in the future without notice. Additionally, we enforce a request rate limit to prevent abuse of the service. If you exceed the 24-hour limit or otherwise abuse the service, the Geocoding API may stop working for you temporarily. If you continue to exceed this limit, your access to the Geocoding API may be blocked.

I suggest that you give it a break, or you might get blocked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜