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

Function PathPropertiesFromXML

tools/openlr/openlr_model_xml.cpp:160–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160bool PathPropertiesFromXML(pugi::xml_node const & locPointNode, openlr::LocationReferencePoint & locPoint)
161{
162 // Last point does not contain path properties.
163 if (strcmp(locPointNode.name(), "olr:last") == 0)
164 return true;
165
166 auto const propNode = locPointNode.child("olr:pathProperties");
167 if (!propNode)
168 {
169 LOG(LERROR, ("Can't parse path properties"));
170 return false;
171 }
172
173 if (!ValueFromXML(propNode.child("olr:dnp"), locPoint.m_distanceToNextPoint))
174 {
175 LOG(LERROR, ("Can't parse dnp"));
176 return false;
177 }
178
179 if (!TableValueFromXML(propNode.child("olr:lfrcnp"), locPoint.m_lfrcnp))
180 {
181 LOG(LERROR, ("Can't parse lfrcnp"));
182 return false;
183 }
184
185 auto const directionNode = propNode.child("olr:againstDrivingDirection");
186 if (!directionNode)
187 {
188 LOG(LERROR, ("Can't parse driving direction"));
189 return false;
190 }
191 locPoint.m_againstDrivingDirection = directionNode.text().as_bool();
192
193 return true;
194}
195
196bool LocationReferencePointFromXML(pugi::xml_node const & locPointNode, openlr::LocationReferencePoint & locPoint)
197{

Callers 1

Calls 3

ValueFromXMLFunction · 0.85
TableValueFromXMLFunction · 0.85
nameMethod · 0.45

Tested by

no test coverage detected