Passing country id and path in a different values to it path for opening polyline files next.

This commit is contained in:
Vladimir Byko-Ianko 2017-10-24 18:06:56 +03:00 committed by mpimenov
parent 174e5435ec
commit 1629527527
4 changed files with 11 additions and 9 deletions

View file

@ -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)
{

View file

@ -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);

View file

@ -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

View file

@ -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); \