osrm-backend/include/engine/plugins/trip.hpp
Michael Bell d74e7b66bd
Support snapping to multiple ways at an input location (#5953)
This PR improves routing results by adding support for snapping to
multiple ways at input locations.

This means all edges at the snapped location can act as source/target
candidates for routing search, ensuring we always find the best route,
and not the one dependent on the edge selected.
2022-08-27 11:36:20 +01:00

50 lines
1.2 KiB
C++

#ifndef TRIP_HPP
#define TRIP_HPP
#include "engine/plugins/plugin_base.hpp"
#include "engine/api/trip_parameters.hpp"
#include "engine/routing_algorithms.hpp"
#include "util/json_container.hpp"
#include <boost/assert.hpp>
#include <algorithm>
#include <cstdlib>
#include <iterator>
#include <memory>
#include <string>
#include <utility>
#include <vector>
namespace osrm
{
namespace engine
{
namespace plugins
{
class TripPlugin final : public BasePlugin
{
private:
const int max_locations_trip;
InternalRouteResult ComputeRoute(const RoutingAlgorithmsInterface &algorithms,
const std::vector<PhantomNodeCandidates> &candidates_list,
const std::vector<NodeID> &trip,
const bool roundtrip) const;
public:
explicit TripPlugin(const int max_locations_trip_) : max_locations_trip(max_locations_trip_) {}
Status HandleRequest(const RoutingAlgorithmsInterface &algorithms,
const api::TripParameters &parameters,
osrm::engine::api::ResultT &json_result) const;
};
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif // TRIP_HPP