MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / HandleRequest

Method HandleRequest

src/engine/plugins/tile.cpp:663–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661} // namespace
662
663Status TilePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
664 const api::TileParameters &parameters,
665 osrm::engine::api::ResultT &result) const
666{
667 BOOST_ASSERT(parameters.IsValid());
668
669 auto &pbf_buffer = std::get<std::string>(result);
670 const auto &facade = algorithms.GetFacade();
671 auto edges = getEdges(facade, parameters.x, parameters.y, parameters.z);
672 auto segregated_nodes = getSegregatedNodes(facade, edges);
673
674 auto edge_index = getEdgeIndex(edges);
675
676 std::vector<routing_algorithms::TurnData> turns;
677
678 // If we're zooming into 16 or higher, include turn data. Why? Because turns make the map
679 // really cramped, so we don't bother including the data for tiles that span a large area.
680 if (parameters.z >= MIN_ZOOM_FOR_TURNS && algorithms.HasGetTileTurns())
681 {
682 turns = algorithms.GetTileTurns(edges, edge_index);
683 }
684
685 encodeVectorTile(facade,
686 parameters.x,
687 parameters.y,
688 parameters.z,
689 edges,
690 edge_index,
691 turns,
692 segregated_nodes,
693 pbf_buffer);
694
695 return Status::Ok;
696}
697} // namespace osrm::engine::plugins

Callers

nothing calls this directly

Calls 7

getEdgesFunction · 0.85
getSegregatedNodesFunction · 0.85
getEdgeIndexFunction · 0.85
encodeVectorTileFunction · 0.85
HasGetTileTurnsMethod · 0.80
GetTileTurnsMethod · 0.80
IsValidMethod · 0.45

Tested by

no test coverage detected