Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Overpass API /api/status #68

Open
sovereign13 opened this issue May 1, 2017 · 0 comments
Open

Support for Overpass API /api/status #68

sovereign13 opened this issue May 1, 2017 · 0 comments

Comments

@sovereign13
Copy link

Issue type
  • Feature Idea
OverPy version
0.4
OS
  • Windows 7

Python version

  • Python 3.6
Summary

It is possible to encounter several HTTP errors when using the Overpass API, relating to the status of a user's queries. For experienced users, helpful information is available regarding these errors from /api/status. The ability to catch and access the information from /api/status would be beneficial to users trying to make a significant number of queries while respecting the rules of the Overpass servers.

Expected results

Something like the following would be expected:

query_string = ('way["highway"~"."](around:20,{},{},);out;').format(lat, lon)
    while True:
        try:
            result = api.query(query_string)
            break
        except (overpy.exception.AnyOverpassError):
            print(result.api_status)

Which gives some output:

'Connected as: 2557965506
Current time: 2017-05-01T16:17:38Z
Rate limit: 2
2 slots available now.
Currently running queries (pid, space limit, time limit, start time):'

As found on the /api/status site.

This would allow users to see information like rate limit and available slots, and adjust the code to respect the status of the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant