diff options
author | Lev Dragunov <l.dragunov@corp.mail.ru> | 2015-08-05 14:23:44 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:59:38 +0300 |
commit | e72318590f5f00853f21239aac44d1f7dcf77e63 (patch) | |
tree | 84c2a762177179719dfec2dbdffa32ddbee67b30 /routing | |
parent | 74eba830c99fdfa22e07e64dab8623af84e9dbf2 (diff) |
[routing] Pedestrian tests version check fix.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/road_graph_router.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index 3bbcc8c245..4dd42a00a2 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -5,9 +5,15 @@ #include "routing/road_graph_router.hpp" #include "routing/route.hpp" +#include "coding/reader_wrapper.hpp" + #include "indexer/feature.hpp" #include "indexer/ftypes_matcher.hpp" #include "indexer/index.hpp" +#include "indexer/mwm_version.hpp" + +#include "platform/country_file.hpp" +#include "platform/local_country_file.hpp" #include "geometry/distance.hpp" @@ -56,7 +62,14 @@ bool CheckMwmVersion(vector<pair<Edge, m2::PointD>> const & vicinities, vector<s for (auto const & vicinity : vicinities) { auto const mwmInfo = vicinity.first.GetFeatureId().m_mwmId.GetInfo(); - if (mwmInfo->GetVersion() < kMinPedestrianMwmVersion) + // mwmInfo gets version from a path of the file, so we must read the version header to be sure. + ModelReaderPtr reader = FilesContainerR(mwmInfo->GetLocalFile().GetPath(MapOptions::Map)) + .GetReader(VERSION_FILE_TAG); + ReaderSrc src(reader.GetPtr()); + + version::MwmVersion version; + version::ReadVersion(src, version); + if (version.timestamp < kMinPedestrianMwmVersion) mwmNames.push_back(mwmInfo->GetCountryName()); } return !mwmNames.empty(); |