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

Problem with generating isochrones form layer. QGis-ORS-tools #178

Closed Geejee67 closed 1 year ago

Geejee67 commented 1 year ago

I have a new laptop and installed QGis 3.30.0 and the ORS-tools plugin. I want to generate Isochrones from a layer. I have a token and generating an isochrone from a single point works fine. However once I try to do this from a layer with single points I get the following error, any ideas how tot solve this?:

_Traceback (most recent call last): File "C:\Users/gesl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\isochrones_layer_proc.py", line 155, in processAlgorithm response = ors_client.request('/v2/isochrones/' + profile, {}, post_json=params) File "C:\Users/gesl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\client.py", line 152, in request f"url: {self.url}\nParameters: {json.dumps(body, indent=2)}", File "C:\PROGRA~1\QGIS33~1.0\apps\Python39\lib\json__init.py", line 234, in dumps return cls( File "C:\PROGRA~1\QGIS33~1.0\apps\Python39\lib\json\encoder.py", line 201, in encode chunks = list(chunks) File "C:\PROGRA~1\QGIS33~1.0\apps\Python39\lib\json\encoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "C:\PROGRA~1\QGIS33~1.0\apps\Python39\lib\json\encoder.py", line 405, in _iterencode_dict yield from chunks File "C:\PROGRA~1\QGIS33~1.0\apps\Python39\lib\json\encoder.py", line 438, in _iterencode o = _default(o) File "C:\PROGRA~1\QGIS33~1.0\apps\Python39\lib\json\encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name__} ' TypeError: Object of type QVariant is not JSON serializable

Execution failed after 0.03 seconden_

MichaelsJP commented 1 year ago

@Geejee67 Thanks for reporting. I guess the new QGIS version has some changes in its class API that are not yet reflected in the plugin. Connected to #177

Geejee67 commented 1 year ago

Hi Julian, True this is the solution. My 'Input Layer ID Field' was a 64bits integer. Once I change this to a 32bit Integer field, ORS-tools works fine again. THX