Exceeded maximum gross distance for locations

19 posts / 0 new
Last post
Humpelkater
Exceeded maximum gross distance for locations

Hello,

I use your API with http://open.mapquestapi.com/directions/v2/routematrix?key=key and a XML-Post for a request to find the times and distances between a set of points.

Now I receive the error "Exceeded maximum gross distance for locations (Max=12000.0, Actual=12738.874 miles)". But my request is not a request for a route. Why do you sum up all the single  distances?

Best regards


MQBrianCoakley
The number of routes and
The number of routes and distance of routes are limited so that the service remains responsive for all users. It would easily and quickly get abused if the restrictions were not in place and all requests would take much longer to respond, if they responded.

Humpelkater
But I have no route with a

But I have no route with a distance of 12.000 miles. I have many single point-to-point requests (oneToMany) in one XML-file and none of these requests have a distance > 400 miles. Should I send 40 single requests instead of one?

In your documentation of the route matrix option you can read only a restriction of  "A One to Many route matrix call can handle up to 100 locations.".

Best regards


MQBrianCoakley
The matrix calculates
The matrix calculates distances from/to all of the locations in the request like A to B then A to C and A to D, not just A to B then C to D and E to F. One to many calculates distances from the first location to all of the others and many to many calculates distances from, well, all of them to all of them. It was originally a method to find driving distance from a search origin to search results, not a batch route distance/time finder.

Humpelkater
Okay, thank you.

Okay, thank you.


kwinterton
I'm having a similar problem,

I'm having a similar problem, my question is how am I supposed to predict that the distances are going to be over the given limit when I'm using the request to find the distances in the first place?


MQBrianCoakley
If there is the potential to
If there is the potential to go over the api limitations you can either plan to send fewer locations in the request and make more requests or you can calculate straight line distances to estimate what route distances could be before sending all of them in.

testlanddispatch
Using Radius Search feature and experiecing the same issue

Hi MapQuest team!

Now trying your great solution to find number of moving objects in the certain area within a certain radius (e.g. players in 300-500 miles to location) and everything is excellent except one minor detail: when using Radius Search with dynamic number of points (we can't predict how many users will appear in the certain location radius) it sometimes goes over the limit of 12000 miles gross and request returns nothing but a limit hit error.

If you could advise a workaround on that to it would be awesome. 

We tried to split request by 5-10 users in each, but it happens to be quite slow when we need to calculate 100-200 users :( So, maybe there's any other option?

Thank you so much!

Best regards,

Denys.


MQBrianCoakley
Can you post a sample request
Can you post a sample request that returns the error?

testlanddispatch
Sample request that sometimes hit the limit

MQBrianCoakley thank you for a quick reply!

It looks like authenticated POST to 

http://www.mapquestapi.com/search/v2/search

with the following data
array(3) {
  ["shapePoints"]=>
  array(2) {
    [0]=>
    string(10) "xx.xxx"
    [1]=>
    string(11) "xx.xxx"
  }
  ["options"]=>
  array(2) {
    ["units"]=>
    string(2) "dm"
    ["radius"]=>
    int(500)
  }
  ["remoteDataList"]=>
  array(78) {
    [0]=>
    array(3) {
      ["key"]=>
      string(1) "0"
      ["name"]=>
      string(4) "1111"
      ["shapePoints"]=>
      array(2) {
        [0]=>
        string(10) "xx.xxx"
        [1]=>
        string(11) "xx.xxx"
      }
    }
    [1]=>
    array(3) {
      ["key"]=>
      string(1) "1"
      ["name"]=>
      string(4) "3799"
      ["shapePoints"]=>
      array(2) {
        [0]=>
        string(10) "xx.xxx"
        [1]=>
        string(11) "xx.xxx"
      }
    }
************************************More alike data goes here*********************************************
    [76]=>
    array(3) {
      ["key"]=>
      string(2) "76"
      ["name"]=>
      string(4) "3069"
      ["shapePoints"]=>
      array(2) {
        [0]=>
        string(13) "xx.xxx"
        [1]=>
        string(14) "xx.xxx"
      }
    }
    [77]=>
    array(3) {
      ["key"]=>
      string(2) "77"
      ["name"]=>
      string(4) "3242"
      ["shapePoints"]=>
      array(2) {
        [0]=>
        string(10) "xx.xxx"
        [1]=>
        string(11) "xx.xxx"
      }
    }
  }
}


MQBrianCoakley
At some point, the difference

At some point, the difference between drive distance and straight line distance becomes less significant. You may be able to do a normal radius search and then a second with units=dm with the closest search results. If there is a large number of provided points, a limit can be set to the points per request. If 95% of the failing requests have 50 points, then anything over 50 can be broken into smaller sets.

 

There is no workaround to bypass the limits.


testlanddispatch
Hi MQBrianCoakley!

Hi MQBrianCoakley!

Thanks for the rapid response!

Could you please advise, maybe there's a way to get points up to the limit calculated without failing the whole request but failing only the onces that exceed the limit? E.g. we send 70 points, first 50 are under the limit, but starting from the 51-st one, limit exceeds. Is there any way to get firts 50 calculated and error starting from the 51-st? or at least to get an error starting from which point limit exceeds?

Thank you so much!

Best regards,

Denys


MQBrianCoakley
Nope, unfortunately, that's
Nope, unfortunately, that's not how it's set up. The request fails completely. It does not compute the portion of the request that could be within the limitations.

testlanddispatch
Also, is there any way to increase 500 miles radius search limit

Also, 

Could you please advise if there's any way to increase limit of 500 miles for the radius search?

Thank you so much!

Regards,

Denys


MQBrianCoakley
There is no workaround to
There is no workaround to bypass the limits.

testlanddispatch
Hi MQBrianCoakley,

Hi MQBrianCoakley,

Sad to hear that :( You definitely should consider to increase limits for your advanced plans :)

Thank you so much!

Best regards,

Denys


MQBrianCoakley
Yup, we've considered it many
Yup, we've considered it many times over the years but there is so little demand for it that it hasn't been pursued. The limits already in place satisfy all but a minute portion of the traffic. It's just not cost effective at this time.

testlanddispatch
Roger. Thank you so much for the clarification!

Roger. Thank you so much for the clarification!


testlanddispatch
Roger. Thank you so much for the clarification!

Roger. Thank you so much for the clarification!