| 264 | } |
| 265 | |
| 266 | bool 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 | |
| 290 | namespace openlr |
no test coverage detected