# Issues With Avoiding Polygon using geojson endpoint

**URL:** https://ask.openrouteservice.org/t/issues-with-avoiding-polygon-using-geojson-endpoint/3767
**Category:** directions
**Created:** [April 7, 2022, 7:34pm UTC](https://ask.openrouteservice.org/t/issues-with-avoiding-polygon-using-geojson-endpoint/3767 "2022-04-07T19:34:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![0zyxel0](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/0zyxel0/32/1440_2.png) [@0zyxel0](https://ask.openrouteservice.org/u/0zyxel0)
#### Post date: [April 7, 2022, 7:34pm UTC](https://ask.openrouteservice.org/t/issues-with-avoiding-polygon-using-geojson-endpoint/3767/1 "2022-04-07T19:34:26Z")

</div>

Hi Everyone,

I am currently trying to implement a simulation of barriers for wheelchair users, But I am having issues using the geojson endpoint with the avoid polygon options.

At some point, the endpoint is routing over the polygon created which must be avoided.

image as such

 ![Capture.PNG](https://ask.openrouteservice.org/uploads/default/original/2X/c/c85459283dd36a729c6799a9a92b6031422ba7a0.jpeg)

my request payload is this to this endpoint  
[https://api.openrouteservice.org/v2/directions/wheelchair/geojson](https://api.openrouteservice.org/v2/directions/wheelchair/geojson)

```auto
{"coordinates":[[8.536961674690248,47.37541343865293],[8.538501262664797,47.37605279697944]],"extra_info":["osmid","waytype","steepness"],"elevation":true,"instructions_format":"html","language":"en","preference":"recommended","options":{"profile_params":{"restrictions":{"maximum_incline":"0","maximum_sloped_kerb":"0.06","minimum_width":1,"surface_type":"cobblestone"},"surface_quality_known":false,"allow_unsuitable":false},"avoid_polygons":{"type":"MultiPolygon","coordinates":[[[[8.537712693214418,47.37623266105217],[8.53755657344699,47.37619830996497],[8.53746008655523,47.376108377757106],[8.537460087087755,47.375997215646805],[8.537556574308635,47.37590728378191],[8.537712693214418,47.37587293290668],[8.537868812120202,47.37590728378191],[8.537965299341082,47.375997215646805],[8.537965299873607,47.376108377757106],[8.537868812981847,47.37619830996497],[8.537712693214418,47.37623266105217]],[[8.538345694541931,47.3756913866087],[8.53818957637705,47.375657035521506],[8.538093090475703,47.37556710331366],[8.538093091008212,47.37545594120334],[8.538189577238668,47.37536600933845],[8.538345694541931,47.37533165846322],[8.538501811845196,47.37536600933845],[8.538598298075652,47.37545594120334],[8.53859829860816,47.37556710331366],[8.538501812706814,47.375657035521506],[8.538345694541931,47.3756913866087]],[[8.537369370460512,47.37580036848699],[8.537213251972974,47.3757660173998],[8.537116765872215,47.37567608519195],[8.53711676640473,47.37556492308163],[8.537213252834597,47.37547499121674],[8.537369370460512,47.37544064034151],[8.537525488086429,47.37547499121674],[8.537621974516297,47.37556492308163],[8.53762197504881,47.37567608519195],[8.537525488948052,47.3757660173998],[8.537369370460512,47.37580036848699]]]]}}}

```

I am not sure where the wrong part of the request is because the avoid polygon works if there is maybe 1 or 2 but if i keep on blocking the routing being generated the routing at some point does not care anymore and it does just go straight to the polygon to be avoided.

Another thing to note is that when i keep on blocking the pathways with barriers the endpoint will complain with a http error 500

 ![Capture3](https://ask.openrouteservice.org/uploads/default/original/2X/2/29c64cc3a545466f50d3eac584775408f6e19932.png)

and on my local ORS docker server it will have this error in the logs

 ![Capture2](https://ask.openrouteservice.org/uploads/default/original/2X/d/d28ba3f0250f95dfd364f941a71101e48520d0b6.png)

Please Advise, Thank you!

---

<div class="post-metadata">

### Author: ![0zyxel0](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/0zyxel0/32/1440_2.png) [@0zyxel0](https://ask.openrouteservice.org/u/0zyxel0)
#### Post date: [April 10, 2022, 6:24pm UTC](https://ask.openrouteservice.org/t/issues-with-avoiding-polygon-using-geojson-endpoint/3767/2 "2022-04-10T18:24:02Z")

</div>

So I found the issue today and it was not really about the API being wrong but my avoid polygon array coordinates in the post request.

I just realized that it needs to be using this structure.

 ![image](https://ask.openrouteservice.org/uploads/default/original/2X/6/64fc75f2191f1b28ac1ba417633ff86a10dafb2c.png)

and not everything in just one array.
