Adds a limit for number of results returned in Nearest service, resolves #2872
This commit is contained in:
committed by
Moritz Kobitzsch
parent
e6fe9d0d67
commit
e3c1b133bf
@@ -51,6 +51,7 @@ namespace engine
|
||||
* - Route
|
||||
* - Table
|
||||
* - Match
|
||||
* - Nearest
|
||||
*
|
||||
* In addition, shared memory can be used for datasets loaded with osrm-datastore.
|
||||
*
|
||||
@@ -65,6 +66,7 @@ struct EngineConfig final
|
||||
int max_locations_viaroute = -1;
|
||||
int max_locations_distance_table = -1;
|
||||
int max_locations_map_matching = -1;
|
||||
int max_results_nearest = -1;
|
||||
bool use_shared_memory = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,9 +15,12 @@ namespace plugins
|
||||
class NearestPlugin final : public BasePlugin
|
||||
{
|
||||
public:
|
||||
explicit NearestPlugin(datafacade::BaseDataFacade &facade);
|
||||
explicit NearestPlugin(datafacade::BaseDataFacade &facade, const int max_results);
|
||||
|
||||
Status HandleRequest(const api::NearestParameters ¶ms, util::json::Object &result);
|
||||
|
||||
private:
|
||||
const int max_results;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user