GIScience / orstools-qgis-plugin

Plugin for QGIS with a set of tools to use openrouteservice API´s, based on openstreetmap
https://plugins.qgis.org/plugins/ORStools/
MIT License
92 stars 31 forks source link

Problems with OSM tools when using point files as input #22

Closed Smithsinarazz closed 7 years ago

Smithsinarazz commented 7 years ago

Hi Nils,

I've been trying to use the OSM tools plugin to calculate accessibility areas around points in a point shapefile. The tool works perfectly if I pick the "map now" option and choose a single location. If I put in a point shapefile I get the following error message:

2017-06-20T21:53:44 1 Traceback (most recent call last): File "C:/Users/Smiths/.qgis2/python/plugins\OSMtools\osm_tools.py", line 231, in run self.access_anal.iterAnalysis() File "C:/Users/Smiths/.qgis2/python/plugins\OSMtools\osm_tools_access.py", line 350, in iterAnalysis feat_list, isochrone_list = self.accRequest(feat_in_list) File "C:/Users/Smiths/.qgis2/python/plugins\OSMtools\osm_tools_access.py", line 170, in accRequest print req IOError: [Errno 9] Bad file descriptor

Similarly, the routing tool works fine if I use the tool to plot start and finish locations, but if I put in a point shapefile as the origin or destination I get the following error:

HTTP status 500: ('internal_server_error', 'server_error', '/o\', '\xe2\x9c\x97') Get request: https://api.openrouteservice.org/directions?api_key=58d904a497c67e00015b45fcc61ee17f1da9474f716f988437760160&coordinates=-1.82524,54.93755|-6.30889033497,49.9126357934&profile=driving-car&preference=fastest&instructions=False&geometry_format=geojson&units=m

Cheers, Jo

giriops commented 7 years ago

I think it results from exceeding the rate limit (40 requests/60 second). Plugin works with files containing up to 10 points.

Smithsinarazz commented 7 years ago

Brilliant, thanks!

  From: giriops <notifications@github.com>

To: nilsnolde/ORStools ORStools@noreply.github.com Cc: Smithsinarazz jo.ellis2801@yahoo.co.uk; Author author@noreply.github.com Sent: Sunday, 25 June 2017, 11:00 Subject: Re: [nilsnolde/ORStools] Problems with OSM tools when using point files as input (#22)

I think it results from exceeding the rate limit (40 requests/60 second). Plugin works with files containing up to 10 points.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

giriops commented 7 years ago

To solve the issue it should be enough to insert a two second delay between a request and the next one

Da: Smithsinarazz [mailto:notifications@github.com] Inviato: lunedì 26 giugno 2017 10:00 A: nilsnolde/ORStools Cc: giriops; Comment Oggetto: Re: [nilsnolde/ORStools] Problems with OSM tools when using point files as input (#22)

Brilliant, thanks!

From: giriops < mailto:notifications@github.com notifications@github.com> To: nilsnolde/ORStools < mailto:ORStools@noreply.github.com ORStools@noreply.github.com> Cc: Smithsinarazz < mailto:jo.ellis2801@yahoo.co.uk jo.ellis2801@yahoo.co.uk>; Author < mailto:author@noreply.github.com author@noreply.github.com> Sent: Sunday, 25 June 2017, 11:00 Subject: Re: [nilsnolde/ORStools] Problems with OSM tools when using point files as input (#22)

I think it results from exceeding the rate limit (40 requests/60 second). Plugin works with files containing up to 10 points.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nilsnolde/ORStools/issues/22#issuecomment-310989716 , or mute the thread https://github.com/notifications/unsubscribe-auth/ADKoORzRxWxFG28-kbEoKoHspXRL7PF4ks5sH2UYgaJpZM4OAJWi . https://github.com/notifications/beacon/ADKoOY5FCKR4EjOV550Se-WIlqygD-p-ks5sH2UYgaJpZM4OAJWi.gif

nilsnolde commented 7 years ago

Hi @Smithsinarazz ,

your second error is indeed due to some internal server limit, but I guess that´s solved already.

Your first error however is annoying me since ages.. Gotta put smth in that avoids this. I print the request to the Python console, mostly for debugging. But for some reason it throws an error now and then. One way to overcome this, is to just try again with the exact same settings. In worst case, restart QGIS. It´s really a random error as far as I know.

Thanks @giriops, actually not a bad idea to programmatically avoid the server limitations. I´ll put it on the to-do list.