/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
generator/mini_roundabout_info.cpp
35 строк
904 B
Maksim Andrianov
[generator] Stable map generation.
16 фев 2021, 15:26
16 фев 2021, 15:26
5ada90f
Код
Авторство
О чём код?
#include "generator/mini_roundabout_info.hpp" #include "coding/file_reader.hpp" #include <algorithm> #include <iterator> #include <utility> namespace generator { MiniRoundaboutInfo::MiniRoundaboutInfo(OsmElement const & element) : m_id(element.m_id), m_coord(element.m_lat, element.m_lon) { } MiniRoundaboutInfo::MiniRoundaboutInfo(uint64_t id, ms::LatLon const & coord, std::vector<uint64_t> && ways) : m_id(id), m_coord(coord), m_ways(std::move(ways)) { } void MiniRoundaboutInfo::Normalize() { std::sort(std::begin(m_ways), std::end(m_ways)); } std::vector<MiniRoundaboutInfo> ReadMiniRoundabouts(std::string const & filePath) { FileReader reader(filePath); ReaderSource<FileReader> src(reader); std::vector<MiniRoundaboutInfo> res; while (src.Size() > 0) res.push_back(ReadMiniRoundabout(src)); return res; } } // namespace generator