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

Function PathFromXML

tools/openlr/decoded_path.cpp:116–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void PathFromXML(pugi::xml_node const & node, DataSource const & dataSource, Path & p)
117{
118 auto const edges = node.select_nodes("RoadEdge");
119 for (auto const & xmlE : edges)
120 {
121 auto e = xmlE.node();
122
123 FeatureID fid;
124 FeatureIdFromXML(e.child("FeatureID"), dataSource, fid);
125
126 auto const isForward = IsForwardFromXML(e.child("IsForward"));
127 auto const segmentId = UintFromXML(e.child("SegmentId"));
128
129 ms::LatLon start, end;
130 LatLonFromXML(e.child("StartJunction"), start);
131 LatLonFromXML(e.child("EndJunction"), end);
132
133 p.push_back(
134 Edge::MakeReal(fid, isForward, segmentId,
135 geometry::PointWithAltitude(mercator::FromLatLon(start), geometry::kDefaultAltitudeMeters),
136 geometry::PointWithAltitude(mercator::FromLatLon(end), geometry::kDefaultAltitudeMeters)));
137 }
138}
139
140void PathToXML(Path const & path, pugi::xml_node & node)
141{

Callers 2

TrafficModeMethod · 0.85
TestSerializeDeserializeFunction · 0.85

Calls 7

FeatureIdFromXMLFunction · 0.85
IsForwardFromXMLFunction · 0.85
UintFromXMLFunction · 0.85
LatLonFromXMLFunction · 0.85
PointWithAltitudeClass · 0.50
FromLatLonFunction · 0.50
push_backMethod · 0.45

Tested by 1

TestSerializeDeserializeFunction · 0.68