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

Function CoordinateFromXML

tools/openlr/openlr_model_xml.cpp:115–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115bool CoordinateFromXML(pugi::xml_node const & node, ms::LatLon const & prevCoord, ms::LatLon & latLon)
116{
117 int32_t lat, lon;
118 if (!GetLatLon(node.child("olr:coordinate"), lat, lon))
119 return false;
120
121 // This constant is provided by the given OpenLR variant
122 // with no special meaning and is used as a factor to store doubles as ints.
123 auto const kOpenlrDeltaFactor = 100000;
124
125 latLon.m_lat = prevCoord.m_lat + static_cast<double>(lat) / kOpenlrDeltaFactor;
126 latLon.m_lon = prevCoord.m_lon + static_cast<double>(lon) / kOpenlrDeltaFactor;
127
128 return true;
129}
130
131bool LinePropertiesFromXML(pugi::xml_node const & linePropNode, openlr::LocationReferencePoint & locPoint)
132{

Callers 1

Calls 1

GetLatLonFunction · 0.85

Tested by

no test coverage detected