From e57df7316957d85534dc78b2d9cb642bfbbeeccd Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Tue, 12 Jan 2016 13:12:42 +0300 Subject: [PATCH] [Old map downloader] Backup mwm before generating routing sections --- defines.hpp | 1 + generator/routing_generator.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/defines.hpp b/defines.hpp index 2cd61ce422..eeb441747a 100644 --- a/defines.hpp +++ b/defines.hpp @@ -43,6 +43,7 @@ #define DOWNLOADING_FILE_EXTENSION ".downloading" #define BOOKMARKS_FILE_EXTENSION ".kml" #define ROUTING_FILE_EXTENSION ".routing" +#define NOROUTING_FILE_EXTENSION ".norouting" #define GEOM_INDEX_TMP_EXT ".geomidx.tmp" #define CELL2FEATURE_SORTED_EXT ".c2f.sorted" diff --git a/generator/routing_generator.cpp b/generator/routing_generator.cpp index 0464fb3f50..ecbf7e9610 100644 --- a/generator/routing_generator.cpp +++ b/generator/routing_generator.cpp @@ -444,11 +444,12 @@ void BuildRoutingIndex(string const & baseDir, string const & countryName, strin LOG(LINFO, ("Collect all data into one file...")); string const mwmPath = localFile.GetPath(MapOptions::Map); - string const mwmWithRoutingPath = mwmPath + ROUTING_FILE_EXTENSION; + string const mwmWithoutRoutingPath = mwmPath + NOROUTING_FILE_EXTENSION; - CHECK(my::CopyFileX(mwmPath, mwmWithRoutingPath), ("Can't copy", mwmPath, "to", mwmWithRoutingPath)); + // Backup mwm file without routing. + CHECK(my::CopyFileX(mwmPath, mwmWithoutRoutingPath), ("Can't copy", mwmPath, "to", mwmWithoutRoutingPath)); - FilesContainerW routingCont(mwmWithRoutingPath, FileWriter::OP_WRITE_EXISTING); + FilesContainerW routingCont(mwmPath, FileWriter::OP_WRITE_EXISTING); mapping.Save(routingCont); @@ -467,7 +468,7 @@ void BuildRoutingIndex(string const & baseDir, string const & countryName, strin routingCont.Finish(); uint64_t sz; - VERIFY(my::GetFileSize(mwmWithRoutingPath, sz), ()); + VERIFY(my::GetFileSize(mwmPath, sz), ()); LOG(LINFO, ("Nodes stored:", stored, "Routing index file size:", sz)); } }