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

Method CameraInfo

generator/collector_camera.cpp:45–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45CameraCollector::CameraInfo::CameraInfo(OsmElement const & element)
46 : m_id(element.m_id)
47 , m_lon(element.m_lon)
48 , m_lat(element.m_lat)
49{
50 // Filter long "maxspeed" dummy strings.
51 auto const maxspeed = element.GetTag("maxspeed");
52 if (maxspeed.empty() || maxspeed.size() > 32)
53 return;
54
55 if (auto const validatedMaxspeed = GetMaxSpeedKmPH(maxspeed))
56 m_speedKmPH = static_cast<uint32_t>(*validatedMaxspeed);
57 else
58 LOG(LWARNING, ("Bad speed format of camera:", maxspeed, ", osmId:", element.m_id));
59}
60
61// static
62CameraCollector::CameraInfo CameraCollector::CameraInfo::Read(ReaderSource<FileReader> & src)

Callers

nothing calls this directly

Calls 4

GetMaxSpeedKmPHFunction · 0.85
GetTagMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected