| 437 | } |
| 438 | |
| 439 | void SaveLineStrings(Writer & writer, MultiGeometry const & geom) |
| 440 | { |
| 441 | auto linesIndent = kIndent4; |
| 442 | auto const lineStringsSize = geom.GetNumberOfLinesWithouTimestamps(); |
| 443 | |
| 444 | if (lineStringsSize > 1) |
| 445 | { |
| 446 | linesIndent = kIndent8; |
| 447 | writer << kIndent4 << "<MultiGeometry>\n"; |
| 448 | } |
| 449 | |
| 450 | for (size_t lineIndex = 0; lineIndex < geom.m_lines.size(); ++lineIndex) |
| 451 | { |
| 452 | auto const & line = geom.m_lines[lineIndex]; |
| 453 | if (line.empty()) |
| 454 | { |
| 455 | LOG(LERROR, ("Unexpected empty Track")); |
| 456 | continue; |
| 457 | } |
| 458 | |
| 459 | // Skip the tracks with the timestamps when writing the <LineString> points. |
| 460 | if (geom.HasTimestampsFor(lineIndex)) |
| 461 | continue; |
| 462 | |
| 463 | writer << linesIndent << "<LineString><coordinates>"; |
| 464 | |
| 465 | writer << PointToLineString(line[0]); |
| 466 | for (size_t pointIndex = 1; pointIndex < line.size(); ++pointIndex) |
| 467 | writer << " " << PointToLineString(line[pointIndex]); |
| 468 | |
| 469 | writer << "</coordinates></LineString>\n"; |
| 470 | } |
| 471 | |
| 472 | if (lineStringsSize > 1) |
| 473 | writer << kIndent4 << "</MultiGeometry>\n"; |
| 474 | } |
| 475 | |
| 476 | void SaveGxTracks(Writer & writer, MultiGeometry const & geom) |
| 477 | { |
no test coverage detected