# QGIS ORS Tools Matrix From Layers KeyError

**URL:** https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461
**Category:** QGIS
**Created:** [January 3, 2022, 8:17pm UTC](https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461 "2022-01-03T20:17:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![austinlindholm](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/austinlindholm/32/1434_2.png) [@austinlindholm](https://ask.openrouteservice.org/u/austinlindholm)
#### Post date: [January 3, 2022, 8:17pm UTC](https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461/1 "2022-01-03T20:17:39Z")

</div>

When run as a Single Process, the Matrix From Layers execution fails with KeyError: ‘INPUT\_AVOID\_FEATURES’.

```auto
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.

---

<div class="post-metadata">

### Author: ![Afni](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/afni/32/1435_2.png) [@Afni](https://ask.openrouteservice.org/u/Afni)
#### Post date: [January 4, 2022, 4:51am UTC](https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461/2 "2022-01-04T04:51:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)
#### Post date: [January 4, 2022, 9:21am UTC](https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461/3 "2022-01-04T09:21:18Z")

</div>

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](https://github.com/GIScience/orstools-qgis-plugin/commit/351eb3d5ab37b601a1b27704324e8763d5e17d03) 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

---

<div class="post-metadata">

### Author: ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)
#### Post date: [January 5, 2022, 9:36am UTC](https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461/4 "2022-01-05T09:36:40Z")

</div>

This [issue is tracked](https://github.com/GIScience/orstools-qgis-plugin/issues/164) in the repository now.

---

<div class="post-metadata">

### Author: ![austinlindholm](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/austinlindholm/32/1434_2.png) [@austinlindholm](https://ask.openrouteservice.org/u/austinlindholm)
#### Post date: [January 6, 2022, 7:01pm UTC](https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461/5 "2022-01-06T19:01:12Z")

</div>

Thanks for the prompt update @amandus!

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

```auto
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!

---

<div class="post-metadata">

### Author: ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)
#### Post date: [January 11, 2022, 2:08pm UTC](https://ask.openrouteservice.org/t/qgis-ors-tools-matrix-from-layers-keyerror/3461/6 "2022-01-11T14:08:33Z")

</div>

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
