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

OSM Tools still not working - Python error #63

Closed wmeinolf closed 6 years ago

wmeinolf commented 6 years ago

Hi Nils, thanks for the fix. Unfortunately I still get a python error with the new 2.1.1 Version. I'm on QGIS 2.18.21. Hopefully the following trace is helpful. What do I wrong? Br Wolfgang

2018-07-04T09:29:01 1 Traceback (most recent call last): File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\osm_tools.py", line 144, in run route.directions_calc() File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\directions.py", line 88, in directions_calc route_dict = self._selectInput() File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\directions.py", line 235, in _selectInput response_dict = geocode.reverse_geocode(self.client, *point_geom) File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\geocode.py", line 17, in reverse_geocode response = client.request('/geocode/reverse', params)['features'][0] File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\client.py", line 164, in request result = self._get_body(response) File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\client.py", line 196, in _get_body error['message']) TypeError: string indices must be integers

2018-07-04T09:30:24 1 Traceback (most recent call last): File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\osm_tools.py", line 144, in run route.directions_calc() File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\directions.py", line 88, in directions_calc route_dict = self._selectInput() File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\directions.py", line 235, in _selectInput response_dict = geocode.reverse_geocode(self.client, *point_geom) File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\geocode.py", line 17, in reverse_geocode response = client.request('/geocode/reverse', params)['features'][0] File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\client.py", line 164, in request result = self._get_body(response) File "C:/Users/WMeinolf/.qgis2/python/plugins\OSMtools\client.py", line 196, in _get_body error['message']) TypeError: string indices must be integers

nilsnolde commented 6 years ago

I'll have a look tonight. Couldn't test v2.x, was hoping the same fix would apply. Maybe some Py2/3 stuff... I'll get back later.

nilsnolde commented 6 years ago

Hmm, curious, I don't have that problem. I just upgraded to the latest 2.1.1 version and it works for me. I can route and calculate isochrones from mapping coordinates and files.

Are you sure you're using v2.1.1? And are you sure that the point 'exists' in case you're mapping? Internally it's calling the geocoder to populate attribute fields.

wmeinolf commented 6 years ago

Thanks vor testing out. I have QGIS also on another machine, which was on 2.18.14 and 2.1. Plugin didn't work. Upgraded plugin to 2.1.1: Worked. Upgraded QGIS to 2.18.21: Still works. But still not on my main machine, where I'm definitely on plugin version 2.1.1. Perhaps I should try a completely fresh install. Sorry for that. I'll do some more research tomorrow.

wmeinolf commented 6 years ago

Feel free to close this issue.

nilsnolde commented 6 years ago

Ok great! Yeah, sometimes QGIS breaks smth for no apparent reason.. Before you do a fresh install (and losing your configs), try to download branch v2.1 as zip and replace the contents of the plugin directory (on Win: <home>\.qgis3\python\plugins or so, on Linux ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/OSMtools).

wmeinolf commented 6 years ago

Both PC used different API key. Tried key from working PC on non working, now both pc work.