MCPcopy Create free account
hub / github.com/comaps/comaps / GetMaxSpeedKmPH

Function GetMaxSpeedKmPH

generator/collector_camera.cpp:32–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30{
31
32std::optional<double> GetMaxSpeedKmPH(std::string const & maxSpeedString)
33{
34 routing::SpeedInUnits speed;
35 if (!generator::ParseMaxspeedTag(maxSpeedString, speed) || !speed.IsNumeric())
36 return {};
37
38 auto const speedKmPh = measurement_utils::ToSpeedKmPH(speed.GetSpeed(), speed.GetUnits());
39 if (speedKmPh < 0.0)
40 return {};
41
42 return {speedKmPh};
43}
44
45CameraCollector::CameraInfo::CameraInfo(OsmElement const & element)
46 : m_id(element.m_id)

Callers 1

CameraInfoMethod · 0.85

Calls 5

ParseMaxspeedTagFunction · 0.85
ToSpeedKmPHFunction · 0.85
IsNumericMethod · 0.80
GetSpeedMethod · 0.45
GetUnitsMethod · 0.45

Tested by

no test coverage detected