Request parameters exceed the server configuration limits


#1

Hello.

I’m trying to compute a pairwise distance matrix. Apparently I’ve exceeded the total of routes are allowed by configuration. My API call consists of 597 locations, which means 356409 routes computation. I’ve made the corresponding changes in the config file (or so I think).

Config (app.config):

{
   "ors":{
     "info": {
       "base_url": "https://openrouteservice.org/",
       "support_mail": "support@openrouteservice.org",
       "author_tag": "openrouteservice",
       "content_licence": "LGPL 3.0"
      },
      "services":{
         "matrix":{
            "enabled":true,
            "maximum_locations":4000000,
            "maximum_visited_nodes":100000,
            "allow_resolve_locations":true,
            "attribution":"openrouteservice.org, OpenStreetMap contributors"
         },
         "isochrones":{
            "enabled":true,
            "maximum_range_distance":[
               {
                  "profiles":"any",
                  "value":50000
               },
               {
                  "profiles":"driving-car, driving-hgv, cycling-regular, foot-walking",
                  "value":100000
               }
            ],
            "maximum_range_time":[
               {
                  "profiles":"any",
                  "value":18000
               },
               {
                  "profiles":"driving-car, driving-hgv, cycling-regular, foot-walking",
                  "value":3600
               }
            ],
            "maximum_intervals":10,
            "maximum_locations":2,
            "allow_compute_area":true,
            "attribution":"openrouteservice.org, OpenStreetMap contributors"
         },
         "routing":{
            "enabled":true,
            "mode":"normal",
            "sources":[
               "/ors-core/data/north-america-latest.osm.pbf"
            ],
            "init_threads":1,
            "attribution":"openrouteservice.org, OpenStreetMap contributors",
            "distance_approximation":true,
            "profiles":{
               "active":[
                   "vehicles-car"
               ],
               "default_params": {
                   "encoder_flags_size": 8,
                   "graphs_root_path": "data/graphs",
                   "elevation_provider": "multi",
                       "elevation_cache_path": "data/elevation_cache",
                   "elevation_clear_cache": true,
                   "instructions": true,
                   "maximum_distance": 100000,
                   "maximum_segment_distance_with_dynamic_weights": 100000,
                   "maximum_waypoints": 50
               },
               "profile-vehicles-car":{
                  "profiles":"driving-car",
                  "parameters":{
                     "encoder_options":"consider_elevation=true|turn_costs=true|block_fords=false|use_acceleration=true",
                     "elevation":true,
                     "preparation":{
                        "min_network_size":200,
                        "min_one_way_network_size":200,
                        "methods":{
                           "ch":{
                              "enabled":true,
                              "threads":8,
                              "weightings":"fastest"
                           },
                           "lm":{
                              "enabled":true,
                              "threads":8,
                              "weightings":"fastest,shortest",
                              "landmarks":24
                           }
                        }
                     },

Erro message:

openrouteservice.exceptions.ApiError: 400 ({'info': {'timestamp': 1559749512432, 'engine': {'build_date': '2019-06-01T20:46:11Z', 'version': '5.0.1'}}, 'error': {'code': 6004, 'message': 'Request parameters exceed the server configuration limits. Only a total of 356409 routes are allowed.'}})

What could I be doind wrong?
Thank you in advance.


#2

@ryuzakyl what is the maximum of locations that still works?


#3

Can you try the latest master branch @ryuzakyl? I introduced a fix for matrix wrt to limits last week:

Note though, that you’ll have to adapt your app.config. Oh wait, that might the problem… Did you pull the latest master recently and didn’t change your app.config? See the note at the bottom of the PR comment linked above, that should fix it.


#4

Hi @timothy.

The the maximum amount of locations currently working is 50. For any number of locations greater than 50, I get the following error message:

openrouteservice.exceptions.ApiError: 400 ({'info': {'engine': {'build_date': '2019-06-01T20:46:11Z', 'version': '5.0.1'}, 'timestamp': 1559765930590}, 'error': {'code': 6004, 'message': 'Request parameters exceed the server configuration limits. Only a total of 3025 routes are allowed.'}})

Perhaps I should update some configurations in the app.config file. Any advice?
Thanks in advance.


#5

That’s why I’m referring to. Please follow my advice and let us know if it worked.


#6

Hi @nils.

It works!!! Thank you very much :wink:.

I apologize for failing to carefully read your previous response.

Thanks once again.
Best regards.


#7

Very nice, glad to hear that :slight_smile:


#8

Hello!
Im a complete n00b to the area, so please be patient! Im getting the same message as ryuzakyl, and my search led me to this post. I have about 150 locations (lat long encoded).

Where (on the website) can I find out what the limitations are? And if they can be overcome?

Thanks in advance for your response


#9

@ryuzakyl was asking wrt to local installation. See here for instructions:

For our API you can see limits here:
https://openrouteservice.org/plans/
https://openrouteservice.org/restrictions/


#10

Ok, thank you for replying. I am using the API.


#11

Ok, lets see if I understand correctly. If I use the API, with app.config on openrouteservice server, there is a limit on maximum number of routes that can be calculated (50x50=2500). If I try to install locally on my machine I can set ors.services.matrix.maximum_routes in app.config to something higher, like 150x150=22,500?


#12

Yes, that’s correct :slight_smile:. There should be plenty of info for troubleshooting in this forum.

Good luck!


#13

First, thank you for all the help youve given. I know Im completely new. I followed the instructions and installed on a server. Endpoints such as http://:8080/ors/status or http://:8080/ors/health appear to work from the browser, but when I call via the API (google apps script) it just doesnt work.

Do I need to install another ORS project to get this working?

I


#14

but when I call via the API (google apps script) it just doesnt work.

Well, hard to troubleshoot with that description;)

What exactly is not working? I have no idea about google apps scripts, but shouldn’t matter, as long as it knows how to do HTTP(S) requests with POST and parse JSON’s.


#15

Google Apps Script is based on Javascript. I have some sample code below, which calls ORS optimization:

  console.log("Hello. Start OptimizeRoute script....");
  //Get StartStop coordinates
  var url = 'https://api.openrouteservice.org/optimization';
  var locnFiles = DriveApp.searchFiles('fullText contains "Locn_Data" ');
  while (locnFiles.hasNext()) {
    var locnFile = locnFiles.next();
    var locnListStr = locnFile.getBlob().getDataAsString();
    var locnListObj = JSON.parse(locnListStr);
    console.log(locnListObj);  
    var options = {
          'headers' : {'ApplicationAccessKey' : '<MyApplication Access Key>',
                       'Accept' : 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8',
                       'Authorization': '<Authorization>' },
          'muteHttpExceptions': true,
          'method' : 'POST',
          'contentType': 'application/json',
          'payload' : locnListStr
      };
      var response = UrlFetchApp.fetch(url, options); 
      var data = JSON.parse(response.getContentText());
      console.log(data); 
      var respText = response.getContentText();
      console.log(response.getContentText());
    }
  }

This code works with url = ‘https://api.openrouteservice.org/optimization , UrlFetchApp returns from being called, with some result. In the url, if I substitute “api.openrouteservices.org” with the name of my server where I installed ORS, the call to UrlFetchApp just fails, doesnt return, and does log anything in the google apps script log file. However, if I go to the test links for my server, they work. E.g
http://{myServer}:8080/ors/routes?profile=driving-car&coordinates=8.676581,49.418204|8.692803,49.409465

Do I have to create api access to my server so I can call it the same way I call api.openrouteservice.org from google apps script?


#16

Ah ok, now I know what you mean. In this case, yes, you’ll have to install more software, as the optimization endpoint is not from our stack. It’s sorta explained in the API playground, but you might’ve missed it.

So, you need the optimizer itself:

And it’s HTTP wrapper:

Both are fairly easy to set up. I’d recommend a 4 core processor, in contrast to ORS Vroom benefits from more processing power than RAM. FYI, we run it on 16GB RAM & 4 cores and can serve up to 30-50 concurrent requests. It calls ORS Matrix endpoint (or OSRM) for the durations, which typically takes longer than solving the VRP.

Our production environment comes from here (the only minor edit compared to upstream was a small change in URL):


#17

Im sorry, it looks like a little bit too much work than I planned for, plus my “server” is an Amazon EC2 freebie that certainly wont come anywhere close to the specs you mentioned. Im doing this for a charity Im a part of, we need to organise up to 300 locations (lat long) so that we can save time and petrol money (gas) when we visit locations.

Im going to try to see if there is another way to achieve our goal. Thanks again for your advice and help!