Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2017-10-24 18:06:56 +0300
committermpimenov <mpimenov@users.noreply.github.com>2017-10-25 17:10:31 +0300
commit1629527527274cc7bf32fb2318a18c82305c0d5f (patch)
tree0e8d401ed04606e7ceafeb21d267a6caaa55a924
parent174e5435ec634b0800e48cb4c19bd2d268d2a42f (diff)
Passing country id and path in a different values to it path for opening polyline files next.
-rw-r--r--generator/generator_tool/generator_tool.cpp2
-rw-r--r--generator/transit_generator.cpp9
-rw-r--r--generator/transit_generator.hpp6
-rw-r--r--routing_common/transit_types.hpp3
4 files changed, 11 insertions, 9 deletions
diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp
index f57c5bbc61..92c9843b4e 100644
--- a/generator/generator_tool/generator_tool.cpp
+++ b/generator/generator_tool/generator_tool.cpp
@@ -321,7 +321,7 @@ int main(int argc, char ** argv)
routing::BuildRoadAltitudes(datFile, FLAGS_srtm_path);
if (!FLAGS_transit_path.empty())
- routing::transit::BuildTransit(datFile, osmToFeatureFilename, FLAGS_transit_path);
+ routing::transit::BuildTransit(path, country, osmToFeatureFilename, FLAGS_transit_path);
if (FLAGS_make_routing_index)
{
diff --git a/generator/transit_generator.cpp b/generator/transit_generator.cpp
index 3e43461310..0025c21001 100644
--- a/generator/transit_generator.cpp
+++ b/generator/transit_generator.cpp
@@ -230,14 +230,15 @@ void DeserializerFromJson::operator()(FeatureIdentifiers & id, char const * name
id = FeatureIdentifiers(osmId.EncodedId() /* osm id */, it->second[0] /* feature id */);
}
-void BuildTransit(string const & mwmPath, string const & osmIdsToFeatureIdPath,
- string const & transitDir)
+void BuildTransit(string const & mwmDir, string const & countryId,
+ string const & osmIdsToFeatureIdPath, string const & transitDir)
{
LOG(LERROR, ("This method is under construction and should not be used for building production mwm "
"sections."));
NOTIMPLEMENTED();
- string const countryId = GetFileName(mwmPath);
+// string const countryId = GetFileName(mwmDir);
+ std::string const mwmPath = my::JoinFoldersToPath(mwmDir, countryId + DATA_FILE_EXTENSION);
string const graphFullPath = my::JoinFoldersToPath(transitDir, countryId + TRANSIT_FILE_EXTENSION);
Platform::EFileType fileType;
@@ -273,7 +274,7 @@ void BuildTransit(string const & mwmPath, string const & osmIdsToFeatureIdPath,
// Note. |gates| has to be deserialized from json before starting writing transit section to mwm since
// the mwm is used to filled |gates|.
vector<Gate> gates;
- DeserializeGatesFromJson(root, my::GetDirectory(mwmPath), countryId, mapping, gates);
+ DeserializeGatesFromJson(root, mwmDir, countryId, mapping, gates);
CHECK(IsValid(gates), (gates));
FilesContainerW cont(mwmPath, FileWriter::OP_WRITE_EXISTING);
diff --git a/generator/transit_generator.hpp b/generator/transit_generator.hpp
index 11ee3cb641..2336a23a20 100644
--- a/generator/transit_generator.hpp
+++ b/generator/transit_generator.hpp
@@ -107,13 +107,13 @@ private:
};
/// \brief Builds the transit section in the mwm.
-/// \param mwmPath relative or full path to an mwm. The name of mwm without extension is considered
+/// \param mwmDir relative or full path to an mwm. The name of mwm without extension is considered
/// as country id.
/// \param transitDir a path to directory with json files with transit graphs.
/// \note An mwm pointed by |mwmPath| should contain:
/// * feature geometry
/// * index graph (ROUTING_FILE_TAG)
-void BuildTransit(std::string const & mwmPath, std::string const & osmIdsToFeatureIdPath,
- std::string const & transitDir);
+void BuildTransit(string const & mwmDir, string const & countryId,
+ string const & osmIdsToFeatureIdPath, string const & transitDir);
} // namespace transit
} // namespace routing
diff --git a/routing_common/transit_types.hpp b/routing_common/transit_types.hpp
index dcf97ffd69..7346c0359a 100644
--- a/routing_common/transit_types.hpp
+++ b/routing_common/transit_types.hpp
@@ -40,7 +40,8 @@ Anchor constexpr kInvalidAnchor = std::numeric_limits<Anchor>::max();
template<class Source> friend class Deserializer; \
friend class DeserializerFromJson; \
friend class routing::TransitGraphLoader; \
- friend void BuildTransit(std::string const & mwmPath, \
+ friend void BuildTransit(std::string const & mwmDir, \
+ std::string const & countryId, \
std::string const & osmIdsToFeatureIdPath, \
std::string const & transitDir); \
template<class Obj> friend void TestSerialization(Obj const & obj); \