| 334 | } |
| 335 | |
| 336 | std::string Info::GetFormattedCoordinate(CoordinatesFormat coordsFormat) const |
| 337 | { |
| 338 | auto const & ll = GetLatLon(); |
| 339 | auto const lat = ll.m_lat; |
| 340 | auto const lon = ll.m_lon; |
| 341 | switch (coordsFormat) |
| 342 | { |
| 343 | default: |
| 344 | case CoordinatesFormat::LatLonDMS: // DMS, comma separated |
| 345 | return measurement_utils::FormatLatLonAsDMS(lat, lon, false /*withComma*/, 2); |
| 346 | case CoordinatesFormat::LatLonDecimal: // Decimal, comma separated |
| 347 | return measurement_utils::FormatLatLon(lat, lon, true /* withComma */); |
| 348 | case CoordinatesFormat::OLCFull: // Open location code, long format |
| 349 | return openlocationcode::Encode({lat, lon}); |
| 350 | case CoordinatesFormat::OSMLink: // Link to osm.org |
| 351 | return measurement_utils::FormatOsmLink(lat, lon, 14); |
| 352 | case CoordinatesFormat::UTM: // Universal Transverse Mercator |
| 353 | { |
| 354 | std::string utmCoords = utm_mgrs_utils::FormatUTM(lat, lon); |
| 355 | if (utmCoords.empty()) |
| 356 | return "UTM: N/A"; |
| 357 | else |
| 358 | return "UTM: " + utmCoords; |
| 359 | } |
| 360 | case CoordinatesFormat::MGRS: // Military Grid Reference System |
| 361 | { |
| 362 | std::string mgrsCoords = utm_mgrs_utils::FormatMGRS(lat, lon, 5); |
| 363 | if (mgrsCoords.empty()) |
| 364 | return "MGRS: N/A"; |
| 365 | else |
| 366 | return "MGRS: " + mgrsCoords; |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | void Info::SetRoadType(RoadWarningMarkType type, std::string const & localizedType, std::string const & distance) |
| 372 | { |
nothing calls this directly
no test coverage detected