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

Function LoadSegments

tools/openlr/openlr_stat/openlr_stat.cpp:172–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172std::vector<LinearSegment> LoadSegments(pugi::xml_document & document)
173{
174 std::vector<LinearSegment> segments;
175 if (!ParseOpenlr(document, segments))
176 {
177 LOG(LERROR, ("Can't parse data."));
178 exit(-1);
179 }
180
181 OpenLRDecoder::SegmentsFilter filter(FLAGS_ids_path, FLAGS_multipoints_only);
182 if (FLAGS_limit != kHandleAllSegments && FLAGS_limit >= 0 && static_cast<size_t>(FLAGS_limit) < segments.size())
183 segments.resize(FLAGS_limit);
184
185 base::EraseIf(segments, [&filter](LinearSegment const & segment) { return !filter.Matches(segment); });
186
187 std::sort(segments.begin(), segments.end(), base::LessBy(&LinearSegment::m_segmentId));
188
189 return segments;
190}
191
192void WriteAssessmentFile(std::string const fileName, pugi::xml_document const & doc,
193 std::vector<DecodedPath> const & paths)

Callers 1

mainFunction · 0.85

Calls 8

ParseOpenlrFunction · 0.85
EraseIfFunction · 0.85
LessByFunction · 0.85
sizeMethod · 0.45
resizeMethod · 0.45
MatchesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected