QGIS ORS Tools Matrix From Layers KeyError

When run as a Single Process, the Matrix From Layers execution fails with KeyError: ‘INPUT_AVOID_FEATURES’.

Input parameters:
{ 'INPUT_END_FIELD' : 'Name', 'INPUT_END_LAYER' : 'C:/username/drive/project/layer1.gpkg|layername=layer1', 'INPUT_PROFILE' : 0, 'INPUT_PROVIDER' : 0, 'INPUT_START_FIELD' : 'name', 'INPUT_START_LAYER' : QgsProcessingFeatureSourceDefinition('C:/username/drive/project/layer2.gpkg|layername=layer2', selectedFeaturesOnly=True, featureLimit=-1, geometryCheck=QgsFeatureRequest.GeometryAbortOnInvalid), 'OUTPUT' : 'TEMPORARY_OUTPUT' }

Traceback (most recent call last):
File "C:\Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\matrix_proc.py", line 91, in processAlgorithm
options = self.parseOptions(parameters, context)
File "C:\Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\base_processing_algorithm.py", line 195, in parseOptions
features_raw = parameters[self.IN_AVOID_FEATS]
KeyError: 'INPUT_AVOID_FEATURES'

Execution failed after 0.01 seconds

Does this fail because INPUT_AVOID_FEATURES is not included in the input parameters? I do not notice this issue when running as a Batch Process because INPUT_AVOID_FEATURES is specified as [] by default, however as a Batch Process I am unable to use only selected features to limit requests.

I have the exact same problem. Was just about to post about it but I’ll wait for an answer on yours. If I find anything in the meantime I’ll keep you informed.

Hi @Afni and @austinlindholm,

it might be because you are using a geopackage as input layer, but not sure yet.
The plugin works best with native QGIS layers and GeoJSON. Geopackage in- and outputs are not tested.

Hmm, the avoid features should be disabled for matrix in this commit but it probably only hides the menu entries but still requires the parameters for the algorithm.

A quick fix would be to just use the previous version of the plugin, until we fixed the issue (up to 1 week probably).

Best regards

This issue is tracked in the repository now.

Thanks for the prompt update @amandus!

I tried the matrix again (1.5.0) using GeoJSON layers and reproduced a similar error.

Traceback (most recent call last):
File "C:\Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\matrix_proc.py", line 91, in processAlgorithm
options = self.parseOptions(parameters, context)
File "C:\Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\base_processing_algorithm.py", line 195, in parseOptions
features_raw = parameters[self.IN_AVOID_FEATS]
KeyError: 'INPUT_AVOID_FEATURES'

Execution failed after 0.03 seconds

Using the previous version (1.4.0) I was able to successfully complete a matrix request, and found no issues using either GeoPackages or GeoJSONs. Thanks!

Hi @austinlindholm,

we have released version 1.5.1 with the fix for this.
As soon as QGIS approved the changes, you can use this version instead.

Best regards

1 Like