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

Method update

src/extractor/intersection/node_based_graph_walker.cpp:38–60  ·  view source on GitHub ↗

update the accumulator

Source from the content-addressed store, hash-verified

36
37// update the accumulator
38void LengthLimitedCoordinateAccumulator::update(const NodeID from_node,
39 const EdgeID via_edge,
40 const NodeID /*to_node*/)
41
42{
43 auto current_coordinates =
44 coordinate_extractor.GetForwardCoordinatesAlongRoad(from_node, via_edge);
45
46 const auto length =
47 util::coordinate_calculation::getLength(current_coordinates.begin(),
48 current_coordinates.end(),
49 util::coordinate_calculation::greatCircleDistance);
50
51 // in case we get too many coordinates, we limit them to our desired length
52 if (length + accumulated_length > max_length)
53 current_coordinates = coordinate_extractor.TrimCoordinatesToLength(
54 std::move(current_coordinates), max_length - accumulated_length);
55
56 coordinates.insert(coordinates.end(), current_coordinates.begin(), current_coordinates.end());
57
58 accumulated_length += length;
59 accumulated_length = std::min(accumulated_length, max_length);
60}
61
62// ---------------------------------------------------------------------------------
63SelectRoadByNameOnlyChoiceAndStraightness::SelectRoadByNameOnlyChoiceAndStraightness(

Callers 9

hashOfFilesFunction · 0.45
hashOfFileFunction · 0.45
constructorMethod · 0.45
getOSRMHashMethod · 0.45
md5FileSyncFunction · 0.45
RouteStepsMethod · 0.45
getNodesInBoundingBoxMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 6

getLengthFunction · 0.85
insertMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected