\brief Fills |tracks| based on file |pathToCsv| content. File |pathToCsv| should be a text file with following lines: , , , , , and so on.
| 130 | /// <Latitude of the first point>, <Longitude of the first point>, <Timestamp in seconds of the |
| 131 | /// first point>, <Latitude of the second point> and so on. |
| 132 | bool Parse(string const & pathToCsv, Tracks & tracks) |
| 133 | { |
| 134 | tracks.clear(); |
| 135 | |
| 136 | std::ifstream csvStream(pathToCsv); |
| 137 | if (!csvStream.is_open()) |
| 138 | return false; |
| 139 | |
| 140 | string line; |
| 141 | while (getline(csvStream, line)) |
| 142 | { |
| 143 | istringstream lineStream(line); |
| 144 | string dummy; |
| 145 | GetString(lineStream, dummy); // mwm id |
| 146 | GetString(lineStream, dummy); // aloha id |
| 147 | |
| 148 | Track track; |
| 149 | while (!lineStream.eof()) |
| 150 | { |
| 151 | double lat; |
| 152 | double lon; |
| 153 | uint64_t timestamp; |
| 154 | if (!GetGpsPoint(lineStream, timestamp, lat, lon)) |
| 155 | return false; |
| 156 | track.emplace_back(static_cast<double>(timestamp), lat, lon); |
| 157 | } |
| 158 | tracks.push_back(std::move(track)); |
| 159 | } |
| 160 | csvStream.close(); |
| 161 | return true; |
| 162 | } |
| 163 | |
| 164 | void GpsPointToGpsInfo(GpsPoint const gpsPoint, GpsInfo & gpsInfo) |
| 165 | { |
no test coverage detected