Parameter 'locations' has incorrect value or format

I am trying to use API for Django REST Framework project purpose, more precisely - to calculate distance between 2 cities (in the essence - between airports of such cities).
here is entire code - @staticmethod def get_coordinates(source, destination): source -
in case when I have 2 cities, from first method I have got 2 coordinates:
Santa Barbara - [-95.361416, 29.784753]
Houston - [-91.570956, 43.759028]

when I try to use this coordinates in my second method like this -
payload = {‘locations’: [source_coordinates, destination_coordinates]}
I receive the following announcement - “Parameter ‘locations’ has incorrect value or format.”

I don’t understand what is mistake and what I have done wrong and how to make all the necessary corrections.

I acutely need help with this issue, so please if you know what is the root of this problem please help me.

Thank you in advance.

Just a small amendment to question - I tried to flip coordinates in coordinates’ lis for each city. But unfortunately it showed another mistake - “message”:“Source point(s) [0, 1] out of bounds: -95.361416,29.784753; -91.570956,43.759028. Destination point(s) [0, 1] out of bounds: -95.361416,29.784753; -91.570956,43.759028”}

So as far as i undestood it’s complex mistake. I suspect initial geo coordinates for each city (source, destionation) are calculated mistakenely cuz they as put in wrong order in list and in addition they are not correct.

So, how can I fix this mistake?


the error is stating that what you pass as locations in your body is not correctly formatted.
According to our API Docs, this should be an array of arrays, e.g.


Make sure that your expression

evaluates to this format.

Best regards

I am having the same issue, but I believe this is in fact how my coordinates are formatted. Here’s an example of the format: [[47.665583, -122.317622],
[47.664471750000004, -122.3116331438112],
[47.675650149999996, -122.32382197199433]].

I think perhaps it’s an issue because I’m passing the array in as a variable, but I’m not sure why. Do you have any other advice?

see 1. in Point not within a radius of 350.0 meters - #9 by amandus