Adds a limit for number of results returned in Nearest service, resolves #2872

This commit is contained in:
Daniel J. Hofmann
2016-09-12 11:47:22 +02:00
committed by Moritz Kobitzsch
parent e27ce0e518
commit d399014633
8 changed files with 68 additions and 11 deletions
+2
View File
@@ -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;
};
}
+4 -1
View File
@@ -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 &params, util::json::Object &result);
private:
const int max_results;
};
}
}