# KeyError: '-1' Generate Matrix

**URL:** <https://ask.openrouteservice.org/t/keyerror-1-generate-matrix/312>\
**Category:** QGIS\
**Created:** [March 13, 2019, 5:33pm UTC](https://ask.openrouteservice.org/t/keyerror-1-generate-matrix/312 "2019-03-13T17:33:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricardovr22](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/r/aeb1de/32.png) [@ricardovr22](https://ask.openrouteservice.org/u/ricardovr22)\
**Post date:** [March 13, 2019, 5:33pm UTC](https://ask.openrouteservice.org/t/keyerror-1-generate-matrix/312/1 "2019-03-13T17:33:31Z")

</div>

Hi  
I’m trying to generate an matrix but I can’t run the command, I always get an error like:

“Traceback (most recent call last):  
File “C:/Users/Ricardo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\matrix\_proc.py”, line 197, in processAlgorithm  
destination\_field = source.fields().field(destination\_field\_id)  
KeyError: ‘-1’”

I was able to run the algorithm using the same points using direction from points.

---

<div class="post-metadata">

**Author:** ![nils](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/nils/32/6_2.png) [@nils](https://ask.openrouteservice.org/u/nils)\
**Post date:** [March 14, 2019, 6:59am UTC](https://ask.openrouteservice.org/t/keyerror-1-generate-matrix/312/2 "2019-03-14T06:59:24Z")

</div>

Hi,  
oops, I’ll create an issue and amend. It’s really just a typo, but it makes it unusable for now if you specify a destination layer different from the source layer.

Sorry for that.

> <https://github.com/GIScience/orstools-qgis-plugin/issues/92>
>
> Results in:
> 
> \`\`\`
> destination\_field = source.fields().field(destination\_field\_…id)
> KeyError: ‘-1’”
> \`\`\`

Cheers  
Nils

---

<div class="post-metadata">

**Author:** ![nils](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/nils/32/6_2.png) [@nils](https://ask.openrouteservice.org/u/nils)\
**Post date:** [March 14, 2019, 7:26am UTC](https://ask.openrouteservice.org/t/keyerror-1-generate-matrix/312/3 "2019-03-14T07:26:31Z")

</div>

Fixed and uploaded to the plugin repo. Should be available within the day.

---

<div class="post-metadata">

**Author:** ![ricardovr22](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/r/aeb1de/32.png) [@ricardovr22](https://ask.openrouteservice.org/u/ricardovr22)\
**Post date:** [March 18, 2019, 10:21am UTC](https://ask.openrouteservice.org/t/keyerror-1-generate-matrix/312/4 "2019-03-18T10:21:44Z")

</div>

This was quick, thank you. I’ll wait for the new version

---

<div class="post-metadata">

**Author:** ![nils](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/nils/32/6_2.png) [@nils](https://ask.openrouteservice.org/u/nils)\
**Post date:** [March 18, 2019, 10:24am UTC](https://ask.openrouteservice.org/t/keyerror-1-generate-matrix/312/5 "2019-03-18T10:24:48Z")

</div>

Oh, it’s approved since a few days. You should be able to upgrade right now, `v1.0.2`.
