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

Function ParseOpenlr

tools/openlr/openlr_model_xml.cpp:292–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290namespace openlr
291{
292bool ParseOpenlr(pugi::xml_document const & document, vector<LinearSegment> & segments)
293{
294 for (auto const segmentXpathNode : document.select_nodes("//reportSegments"))
295 {
296 LinearSegment segment;
297 auto const & node = segmentXpathNode.node();
298 if (!IsLocationReferenceTag(node) && !IsCoordinatesTag(node))
299 {
300 LOG(LWARNING, ("A segment with a strange tag. It is not <coordinates>"
301 " or <optionLinearLocationReference>, skipping..."));
302 continue;
303 }
304
305 if (!SegmentFromXML(node, segment))
306 return false;
307
308 segments.push_back(segment);
309 }
310 return true;
311}
312
313bool SegmentFromXML(pugi::xml_node const & segmentNode, LinearSegment & segment)
314{

Callers 1

LoadSegmentsFunction · 0.85

Calls 4

IsLocationReferenceTagFunction · 0.85
IsCoordinatesTagFunction · 0.85
SegmentFromXMLFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected