diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2015-09-14 14:00:58 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:05:21 +0300 |
commit | b4c9f13918384c7c0023c622c9f349facd7b6be1 (patch) | |
tree | 577b8f1c394ecde66683fd03a29080abc59c924d /generator | |
parent | 60249c88138aecefc525d4267d47bb1c7bfc27ec (diff) |
Add generator_tool option for set mwm version for all dataset
Diffstat (limited to 'generator')
-rw-r--r-- | generator/feature_sorter.cpp | 9 | ||||
-rw-r--r-- | generator/generate_info.hpp | 2 | ||||
-rw-r--r-- | generator/generator_tool/generator_tool.cpp | 6 |
3 files changed, 12 insertions, 5 deletions
diff --git a/generator/feature_sorter.cpp b/generator/feature_sorter.cpp index 25654a96a7..e44a2901b0 100644 --- a/generator/feature_sorter.cpp +++ b/generator/feature_sorter.cpp @@ -95,12 +95,13 @@ namespace feature vector<MetadataIndexValueT> m_MetadataIndex; DataHeader m_header; + uint32_t m_versionDate; gen::OsmID2FeatureID m_osm2ft; public: - FeaturesCollector2(string const & fName, DataHeader const & header) - : FeaturesCollector(fName + DATA_FILE_TAG), m_writer(fName), m_header(header) + FeaturesCollector2(string const & fName, DataHeader const & header, uint32_t versionDate) + : FeaturesCollector(fName + DATA_FILE_TAG), m_writer(fName), m_header(header), m_versionDate(versionDate) { m_MetadataWriter.reset(new FileWriter(fName + METADATA_FILE_TAG)); @@ -117,7 +118,7 @@ namespace feature // write version information { FileWriter w = m_writer.GetWriter(VERSION_FILE_TAG); - version::WriteVersion(w); + version::WriteVersion(w, m_versionDate); } // write own mwm header @@ -589,7 +590,7 @@ namespace feature // Transform features from raw format to optimized format. try { - FeaturesCollector2 collector(datFilePath, header); + FeaturesCollector2 collector(datFilePath, header, info.m_versionDate); for (size_t i = 0; i < midPoints.m_vec.size(); ++i) { diff --git a/generator/generate_info.hpp b/generator/generate_info.hpp index f92f67fba9..0713d1bf64 100644 --- a/generator/generate_info.hpp +++ b/generator/generate_info.hpp @@ -42,6 +42,8 @@ struct GenerateInfo OsmSourceType m_osmFileType; string m_osmFileName; + uint32_t m_versionDate = 0; + vector<string> m_bucketNames; bool m_createWorld = false; diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp index cb02448787..3339ac991a 100644 --- a/generator/generator_tool/generator_tool.cpp +++ b/generator/generator_tool/generator_tool.cpp @@ -21,6 +21,8 @@ #include "coding/file_name_utils.hpp" +#include "base/timer.hpp" + #include "defines.hpp" #include "platform/platform.hpp" @@ -70,7 +72,7 @@ DEFINE_bool(make_cross_section, false, "Make corss section in routing file for c DEFINE_string(osm_file_name, "", "Input osm area file"); DEFINE_string(osm_file_type, "xml", "Input osm area file type [xml, o5m]"); DEFINE_string(user_resource_path, "", "User defined resource path for classificator.txt and etc."); - +DEFINE_uint64(planet_version, my::TodayAsYYMMDD(), "Version as YYMMDD, by default - today"); int main(int argc, char ** argv) { @@ -104,6 +106,8 @@ int main(int argc, char ** argv) genInfo.m_failOnCoasts = FLAGS_fail_on_coasts; genInfo.m_preloadCache = FLAGS_preload_cache; + genInfo.m_versionDate = static_cast<uint32_t>(FLAGS_planet_version); + if (!FLAGS_node_storage.empty()) genInfo.SetNodeStorageType(FLAGS_node_storage); if (!FLAGS_osm_file_type.empty()) |