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
91 stars 31 forks source link

ORS Tools Python Code error #174

Closed pachingum closed 1 year ago

pachingum commented 1 year ago

Hi guys, I get this error message when executing the ORS tool plugin for roadmap. Please how can I resolve this error. I am not a coding person. Just familiar with python as a coding language

<<Python error: An error has occurred while executing Python code: See message log (Python Error) for more details>>

This is from the message log

2022-10-30T16:07:50 INFO Plugin installed successfully 2022-10-30T16:11:41 WARNING Python error : An error has occurred while executing Python code: See message log (Python Error) for more details.

2022-10-30T16:11:39 INFO url: https://api.openrouteservice.org/v2/directions/driving-car/geojson? Parameters: { "preference": "fastest", "geometry": "true", "instructions": "false", "elevation": true, "id": 1, "coordinates": [ [ 1037143.408245, 455662.239012 ], [ 1024929.472874, 446818.638681 ], [ 1027666.326092, 463080.946388 ] ] } 2022-10-30T16:11:40 CRITICAL Feature ID 1 caused a ApiError: 400 ({"error":{"code":2004,"message":"Request parameters exceed the server configuration limits. The approximated route distance must not be greater than 6000000.0 meters."},"info":{"engine":{"version":"6.8.0","build_date":"2022-10-21T14:34:31Z"},"timestamp":1667142705654}}) 2022-10-30T16:11:40 CRITICAL ApiError: 400 ({"error":{"code":2004,"message":"Request parameters exceed the server configuration limits. The approximated route distance must not be greater than 6000000.0 meters."},"info":{"engine":{"version":"6.8.0","build_date":"2022-10-21T14:34:31Z"},"timestamp":1667142705654}})

Please how can I resolve this error. I am not a coding person. Just familiar with python as a coding language

koebi commented 1 year ago

Hey, the openrouteservice uses geographic coordinates, i.e. coordinates in degrees. What you sent seem to be metric coordinates, that are thus way out of the accepted ranges of -180 to 180 for longitude and -90 to 90 for latitude.

I guess setting your project CRS correctly (i.e. to 4326 or the like) should fix the issue :)