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

Provide error logs and prevent freezing system for ORS internal errors #56

Closed temospena closed 5 years ago

temospena commented 6 years ago

Hi. I really like this API, thanks!

I'm trying to use the route (row to row) between 1000 points that are in a city, so not that far away from each others. When opting for driving and walking regular, the fastest and the shortest, runs with no problem. When I choose cycling regular (fastest or shortest), it starts to run, and then it gets stuck forever in the message "Requesting analysis from ORS...", at 16%. I can see it using the quota of 40/min on my user dashboard, every time I refresh it ads more, but it gets stuck at 362. It is not a quota problem, I'm waiting more than 1 day to run it.

Do you know what it may be, if that transportation mode has another requirements different than car or walk?

nilsnolde commented 6 years ago

The difference between the profiles is it uses a different road graph, so our APIs could get stuck for cycling-regular, when there's no route for bikes for some reason. However, it should throw an error message in that case.

Is it always the same location pair messing it up? If so, can you post the request parameters, i.e. profile, coordinates, any additional parameters you set in the GUI?

temospena commented 6 years ago

Hi nilsnode, Thank you for your reply.

In fact it shows an error, showing the coordinates of the first pair that gets stuck, but it is very quick and the error disappears, so I can't identify on the table. If it was logging the ID or even the coordinates on the log error messages, it would be easier to identify the problematic pairs. But after all, I found 4 problematic OD pairs. The parameters were: cycling-regular, fastest, row by row. The coordinates of the points are:

ID | O_Lat | O_Long | D_Lat | D_Long 989 | 38.7161417 | -9.1367400 | 38.7147636 | -9.1259705 189 | 38.7260017 | -9.1325994 | 38.7791838 | -9.1332335 505 | 38.7007466 | -9.3802553 | 38.8027935 | -9.1393041 1407 | 38.6119220 | -9.1336965 | 38.7501646 | -9.1488146

Thanks

nilsnolde commented 6 years ago

Hi, yes, I can confirm that the first 2 routes cannot be calculated with a cycling-x profile:

{
    "error": {
        "code": 2009,
        "message": "Route could not be found - Unable to find a route between points 1 (-9.1325994 38.7260017) and 2 (-9.1332335 38.7791838)."
    },
    "info": {
        "engine": {
            "version": "4.5.0",
            "build_date": "2018-03-26T12:51:50Z"
        },
        "timestamp": 1527091866037
    }
}

But you're right: I have to change the plugin to write some sort of log with requests and at least error messages. I have some time on my hands the next 7-8 days, I might finally go for the long-dreaded refactoring of the whole code-base and include this fix.

In the meantime, if you encounter anything like this again:

Try our interactive request console (press Switch to Console in the upper right). This will let you request directly and see the error message (if any). Or use tools like Postman, very useful to query APIs sustainably.

nilsnolde commented 5 years ago

Also this issue is addressed in the development branch. ORS Tools writes to its own QGIS log now, if there's an API error.

nilsnolde commented 5 years ago

fixed in newest master and available in plugin repo