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

Request ORS v2 API #99

Closed
nilsnolde opened this issue Apr 15, 2019 · 5 comments
Closed

Request ORS v2 API #99

nilsnolde opened this issue Apr 15, 2019 · 5 comments
Assignees

Comments

@nilsnolde
Copy link
Contributor

Sometime in 2019

@nilsnolde nilsnolde self-assigned this Apr 15, 2019
@SlowMo24
Copy link

SlowMo24 commented Apr 30, 2019

Hey Nils,
this plugin is excellent! Could you in the meantime catch the error thrown when querying v2-api and notify the user. I just wasted so much time trying to run the plugin against my local docker built from ors-master 🙈 .
Cheers

@nilsnolde
Copy link
Contributor Author

Hm, also master builds still have v1 API exposed. Is there any specific settings that only enables v2? Or did you specify .../v2 in the base URL in the settings?

@SlowMo24
Copy link

SlowMo24 commented Apr 30, 2019

I am actually sorry to hear that because that means something is wrong on my side ;-)
I created my local instance using the default settings specified here: https://github.com/GIScience/openrouteservice/tree/master/docker
ad tried to access the api using http://localhost:8080/ors
If I understand the stacktrace right the response-header is different from what is expected and that is causing an error (X-RateLimit-Limit is not defined).

Ein Fehler trat bei der Ausführung von Python-Code auf: 

KeyError: 'X-Ratelimit-Limit' 
Traceback (most recent call last):
  File "/home/moritz/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ORStools/gui/ORStoolsDialog.py", line 257, in run_gui_control
    response = clnt.request(provider['endpoints']['directions'], params)
  File "/home/moritz/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ORStools/core/client.py", line 203, in request
    configmanager.write_env_var(env_var, response.headers[self.ENV_VARS[env_var]])
KeyError: 'X-Ratelimit-Limit'


Python-Version: 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] 
QGIS-Version: 3.4.7-Madeira Madeira, 5c56989 

@nilsnolde
Copy link
Contributor Author

nilsnolde commented Apr 30, 2019

Hm crap.. That's API indepedent (you actually requested against v1, http://localhost:8080/ors/v2 is v2).

Problem is that your local server is of course not rate limited and not exposing those headers. I didn't think about that when I set up that feature. Ok, I'll get to this within the week.

As a workaround you can go into the code and remove the lines dealing with those environment variables.

@nilsnolde
Copy link
Contributor Author

fixed in v1.1.0

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

No branches or pull requests

2 participants