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

Function CoordinatesFromXML

tools/openlr/openlr_model_xml.cpp:266–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266bool CoordinatesFromXML(pugi::xml_node const & coordsNode, openlr::LinearLocationReference & locRef)
267{
268 if (!coordsNode)
269 {
270 LOG(LERROR, ("Can't get <coordinates>."));
271 return false;
272 }
273
274 auto const latLonStart = LatLonFormXML(coordsNode.child("start"));
275 auto const latLonEnd = LatLonFormXML(coordsNode.child("end"));
276 if (!latLonStart || !latLonEnd)
277 {
278 LOG(LERROR, ("Can't get <start> or <end> of <coordinates>."));
279 return false;
280 }
281
282 LOG(LINFO, ("from:", *latLonStart, "to:", *latLonEnd));
283 locRef.m_points.resize(2);
284 locRef.m_points[0].m_latLon = *latLonStart;
285 locRef.m_points[1].m_latLon = *latLonEnd;
286 return true;
287}
288} // namespace
289
290namespace openlr

Callers 1

SegmentFromXMLFunction · 0.85

Calls 2

LatLonFormXMLFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected