# Matrix with origens different from destinations

**URL:** <https://ask.openrouteservice.org/t/matrix-with-origens-different-from-destinations/3566>\
**Category:** matrix\
**Created:** [January 28, 2022, 3:05pm UTC](https://ask.openrouteservice.org/t/matrix-with-origens-different-from-destinations/3566 "2022-01-28T15:05:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimKra](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/timkra/32/1489_2.png) [@TimKra](https://ask.openrouteservice.org/u/TimKra)\
**Post date:** [January 28, 2022, 3:05pm UTC](https://ask.openrouteservice.org/t/matrix-with-origens-different-from-destinations/3566/1 "2022-01-28T15:05:49Z")

</div>

Hello ORS team,

For a routing problem with more than 50 locations I want to determine the distance between all locations with ORS using a Matrix. However, I saw that in the Matrix every point in locations is paired with each other. This would make it for example not possible to determine the distances between locations 1 to 50 and locations 51 to 100, in case of 100 locations. It is also not possible to determine it with Directions as this would take 50 \* 50 \* 2 = 5000 requests and the max daily quota for Directions is 2000.  
Is it possible to set up a Matrix request where the From locations are different than the To locations?

| From/To | Locations 1 to 50 | Locations 51 to 100 |
| --- | --- | --- |
| **Locations 1 to 50** | Possible | Not Possible |
| **Locations 51 to 100** | Not Possible | Possible |

---

<div class="post-metadata">

**Author:** ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)\
**Post date:** [January 28, 2022, 3:10pm UTC](https://ask.openrouteservice.org/t/matrix-with-origens-different-from-destinations/3566/2 "2022-01-28T15:10:59Z")

</div>

Hey,

when issuing a matrix request, you can set a subset of the locations as `sources` and another as `destinations`. Have a look at [the API docs](https://openrouteservice.org/dev/#/api-docs/v2/matrix/%7Bprofile%7D/post) on how to do that.

I hope that answers your question 🙂

Best regard

---

<div class="post-metadata">

**Author:** ![TimKra](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/timkra/32/1489_2.png) [@TimKra](https://ask.openrouteservice.org/u/TimKra)\
**Post date:** [January 28, 2022, 3:17pm UTC](https://ask.openrouteservice.org/t/matrix-with-origens-different-from-destinations/3566/3 "2022-01-28T15:17:40Z")

</div>

Thanks! Now the meaning `sources` and `destinations` is clear and it is working!
