Description:I have used google distance matrix api to calculate road distances from my place to some near by places it was working fine when I have tested the code but when we have increased the number of records it has started giving the "MAX_DIMENSION_EXCEEDED" exception it seems that one can't calculate more distances as I have nearly 200 destination in total for which I have to calculate distances need help.
Posted by: Umer khan | Posted on: May 09, 2019
2
There is some limitations when you are using google distance matrix api and for complete details you can read this. and for your concerned part following are some point that are effecting your code.
-Maximum of 25 origins or 25 destinations per request.
-Maximum 100 elements per server-side request.
-Maximum 100 elements per client-side request.
-1000 elements per second (EPS), calculated as the sum of client-side and server-side queries.
So what you have do is break your destinations into chucks of 25 destinations per request once your destinations count reaches to 100 then for further requests you have to wait for 2 seconds only then you will be able to fetch distance for next 100 destinations.
Replied by: Junaid Aziz | Replied on: May 24, 2019