# python

**URL:** https://ask.openrouteservice.org/c/sdks/python/12.md

[Latest](https://ask.openrouteservice.org/latest.md) · [Categories](https://ask.openrouteservice.org/categories.md)

---

## [About the python category](https://ask.openrouteservice.org/t/about-the-python-category/20)

<div class="topic-metadata">

**Author:** [@openrouteservice](https://ask.openrouteservice.org/u/openrouteservice)\
**Replies:** 0

</div>

---

## [Error code 3004 in localhost (and then error 3099)](https://ask.openrouteservice.org/t/error-code-3004-in-localhost-and-then-error-3099/4889)

<div class="topic-metadata">

**Author:** [@mattiascalas](https://ask.openrouteservice.org/u/mattiascalas)\
**Replies:** 3\
**Last updated:** [May 24, 2023, 1:36pm UTC](https://ask.openrouteservice.org/t/error-code-3004-in-localhost-and-then-error-3099/4889 "2023-05-24T13:36:05Z")

</div>

I’m trying to combine multiple processing in one python code, so I’m switching from QGIS to an Anaconda environment. I already have correctly deployed my local server, and some tests are doing well: import openrouteserv…

---

## [Options avoid highway and tollway](https://ask.openrouteservice.org/t/options-avoid-highway-and-tollway/1856)

<div class="topic-metadata">

**Author:** [@Aaron-JE](https://ask.openrouteservice.org/u/Aaron-JE)\
**Replies:** 3\
**Last updated:** [March 31, 2023, 8:45am UTC](https://ask.openrouteservice.org/t/options-avoid-highway-and-tollway/1856 "2023-03-31T08:45:51Z")

</div>

Morning! I was wondering is there is any way to make isochrones which avoids highways and tollways. Itd be nice also to know if one can retreive the rest of the “options” tag from the api Thanks!

---

## [Error when I generate a string that gets passed into the body of my matrix request](https://ask.openrouteservice.org/t/error-when-i-generate-a-string-that-gets-passed-into-the-body-of-my-matrix-request/4718)

<div class="topic-metadata">

**Author:** [@mbrantley94](https://ask.openrouteservice.org/u/mbrantley94)\
**Replies:** 3\
**Last updated:** [March 30, 2023, 10:55pm UTC](https://ask.openrouteservice.org/t/error-when-i-generate-a-string-that-gets-passed-into-the-body-of-my-matrix-request/4718 "2023-03-30T22:55:47Z")

</div>

in python, I am trying to generate a string that gets passed into the body of my request. I have confirmed the headers are correct. for example: ORSbody = '{"locations":\['+locations+'\],"metrics":\["distance","duration"\]…

---

## [ORS python library for optimization : How to avoid Highways?](https://ask.openrouteservice.org/t/ors-python-library-for-optimization-how-to-avoid-highways/3855)

<div class="topic-metadata">

**Author:** [@julienreichenb](https://ask.openrouteservice.org/u/julienreichenb)\
**Replies:** 6\
**Last updated:** [May 12, 2022, 7:44am UTC](https://ask.openrouteservice.org/t/ors-python-library-for-optimization-how-to-avoid-highways/3855 "2022-05-12T07:44:33Z")

</div>

Hello there, I am struggling with an optimization problem. I used this tutorial but I replaced the coordinates with mine : Leverage fleet scheduling for disaster response | Openrouteservice Everything is working so far…

---

## [Optimization starting and ending at the same location](https://ask.openrouteservice.org/t/optimization-starting-and-ending-at-the-same-location/4201)

<div class="topic-metadata">

**Author:** [@JIanWu](https://ask.openrouteservice.org/u/JIanWu)\
**Replies:** 3\
**Last updated:** [September 27, 2022, 10:19am UTC](https://ask.openrouteservice.org/t/optimization-starting-and-ending-at-the-same-location/4201 "2022-09-27T10:19:24Z")

</div>

I am running a delivery service, where I always need to start at (longitude\_home, latitude\_home). I will then have different addresses that I need to visit given in a random order. I am in doubt if the code that I use cu…

---

## [Matrix API returning None for all](https://ask.openrouteservice.org/t/matrix-api-returning-none-for-all/4087)

<div class="topic-metadata">

**Author:** [@rossb97](https://ask.openrouteservice.org/u/rossb97)\
**Replies:** 1\
**Last updated:** [August 17, 2022, 8:26am UTC](https://ask.openrouteservice.org/t/matrix-api-returning-none-for-all/4087 "2022-08-17T08:26:32Z")

</div>

Hi, I’m using the matrix API to get driving time between many origins and destinations however when I run the request it seems that all of the durations fetched are returned as None. I’ve redacted the actual lat and long…

---

## [Many to many distance matrix in python](https://ask.openrouteservice.org/t/many-to-many-distance-matrix-in-python/3957)

<div class="topic-metadata">

**Author:** [@barbosasilva.roberta](https://ask.openrouteservice.org/u/barbosasilva.roberta)\
**Replies:** 6\
**Last updated:** [July 27, 2022, 1:34pm UTC](https://ask.openrouteservice.org/t/many-to-many-distance-matrix-in-python/3957 "2022-07-27T13:34:37Z")

</div>

Hi, I’d like to know how i can make a many-to-many query to calculate de distance in km and driving car option for diffent locations of origin and destination. I have a dataframe in which one column has the latitude and…

---

## [From API to local hosted VROOM + ORS via python SDK](https://ask.openrouteservice.org/t/from-api-to-local-hosted-vroom-ors-via-python-sdk/3844)

<div class="topic-metadata">

**Author:** [@mcworkaholic](https://ask.openrouteservice.org/u/mcworkaholic)\
**Replies:** 2\
**Last updated:** [May 2, 2022, 7:38pm UTC](https://ask.openrouteservice.org/t/from-api-to-local-hosted-vroom-ors-via-python-sdk/3844 "2022-05-02T19:38:35Z")

</div>

Hello all you wonderful people, I’ve been able to setup ORS (port 8080, server status: healthy) and VROOM (listening on port 3000, sent request, code = 200) correctly with no issues. Previously I was able to use the api…

---

## [Optimization starting point](https://ask.openrouteservice.org/t/optimization-starting-point/3101)

<div class="topic-metadata">

**Author:** [@peterflier](https://ask.openrouteservice.org/u/peterflier)\
**Replies:** 1\
**Last updated:** [August 24, 2021, 5:16pm UTC](https://ask.openrouteservice.org/t/optimization-starting-point/3101 "2021-08-24T17:16:55Z")

</div>

I would like the optimization service to select the best starting point based on jobs, but when I leave the start value blank / == None for vehicle(s), I receive the following error: openrouteservice.exceptions.ApiError…

---

## [How to get and to know all the possible map tiles values](https://ask.openrouteservice.org/t/how-to-get-and-to-know-all-the-possible-map-tiles-values/2598)

<div class="topic-metadata">

**Author:** [@amrmb](https://ask.openrouteservice.org/u/amrmb)\
**Replies:** 1\
**Last updated:** [March 8, 2021, 1:05pm UTC](https://ask.openrouteservice.org/t/how-to-get-and-to-know-all-the-possible-map-tiles-values/2598 "2021-03-08T13:05:57Z")

</div>

i would like to know how to find or get all possibe tiles’ names?according to the tutorial i am following here: https://python-visualization.github.io/folium/quickstart.html it used to different map tiles for two diff…

---

## [How to get multiple directions options via python](https://ask.openrouteservice.org/t/how-to-get-multiple-directions-options-via-python/2395)

<div class="topic-metadata">

**Author:** [@ShaharYe](https://ask.openrouteservice.org/u/ShaharYe)\
**Replies:** 3\
**Last updated:** [December 29, 2020, 2:00pm UTC](https://ask.openrouteservice.org/t/how-to-get-multiple-directions-options-via-python/2395 "2020-12-29T14:00:57Z")

</div>

Hey guys, I’m coding a routing tool, and in order to achieve my target I have to get more than one option for the directions. How do I get it from the API?

---

## [Correct exception handling with openrouteservice.exceptions](https://ask.openrouteservice.org/t/correct-exception-handling-with-openrouteservice-exceptions/1734)

<div class="topic-metadata">

**Author:** [@aarondlc](https://ask.openrouteservice.org/u/aarondlc)\
**Replies:** 3\
**Last updated:** [May 24, 2020, 2:08pm UTC](https://ask.openrouteservice.org/t/correct-exception-handling-with-openrouteservice-exceptions/1734 "2020-05-24T14:08:53Z")

</div>

Good morning, I’m trying to create a try/except block to catch timeout and api errors, but It doesnt seem to recognize the errors, for example: try: api\_key = 'erersfsdfdsfdsfs' except openrouteservice.exceptions.A…

---

## [HTTP Error 502: Bad Gateway](https://ask.openrouteservice.org/t/http-error-502-bad-gateway/1219)

<div class="topic-metadata">

**Author:** [@ascripter](https://ask.openrouteservice.org/u/ascripter)\
**Replies:** 3\
**Last updated:** [January 17, 2020, 8:11am UTC](https://ask.openrouteservice.org/t/http-error-502-bad-gateway/1219 "2020-01-17T08:11:35Z")

</div>

I’m using the python module openrouteservice to download several distance matrices. I often get a 502 error. Even retrying several times after several minutes doesn’t help. The last days it happened occasionally, so I a…

---

## [Runtime Error when multi threading](https://ask.openrouteservice.org/t/runtime-error-when-multi-threading/592)

<div class="topic-metadata">

**Author:** [@pablopardoz](https://ask.openrouteservice.org/u/pablopardoz)\
**Replies:** 2\
**Last updated:** [May 31, 2019, 12:05pm UTC](https://ask.openrouteservice.org/t/runtime-error-when-multi-threading/592 "2019-05-31T12:05:41Z")

</div>

Hi. I’m using the Python library for ORS directions, and sometimes I’m getting some errors (maybe 1 of each 100 queries thrown) File "python3.5/site-packages/openrouteservice/validator.py", line 683, in \_directions\_val…

---

## [API compatibility issues with python bindings](https://ask.openrouteservice.org/t/api-compatibility-issues-with-python-bindings/186)

<div class="topic-metadata">

**Author:** [@flonix8](https://ask.openrouteservice.org/u/flonix8)\
**Replies:** 6\
**Last updated:** [January 8, 2019, 1:27pm UTC](https://ask.openrouteservice.org/t/api-compatibility-issues-with-python-bindings/186 "2019-01-08T13:27:18Z")

</div>

Dear ORS community, I’ve been trying to use the python bindings (from the openrouteservice-py project) with a downloaded and locally run version of openrouteservice (using the docker build task). I sadly could not get …
